• Resolved thebigdotco

    (@thebigdotco)


    Having some difficulty grabbing date specific info from the database:

            $start_date = date(‘Y-m-d’, strtotime($dates[0]));

            $end_date = date(‘Y-m-d’, strtotime($dates[1] . ‘ +1 day’));

            include_once( WP_PLUGIN_DIR . ‘/wp-slimstat/admin/view/wp-slimstat-db.php’ );

            $time_range_condition = “strtotime between ‘” . $start_date . “‘ and ‘” . $end_date . “‘”;

            wp_slimstat_db::init($time_range_condition);  

Viewing 1 replies (of 1 total)
  • Plugin Support Amir

    (@amirfallah)

    Hi @thebigdotco,

    I apologize for the delay in responding.
    You can use the sample code below to retrieve information.

    include_once( WP_PLUGIN_DIR . '/wp-slimstat/admin/view/wp-slimstat-db.php' );
    wp_slimstat_db::init();
    $result = wp_slimstat_db::get_recent($_column = '*', $_where = 'dt between startDate and endDate', $_having = '', $_use_date_filters = true, $_as_column = '', $_more_columns = '' );

    Replace the startDate and endDate in the code with the dates in Unix Time format.

    Please let me know if you have any further questions or need assistance.
    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Outputting data in php’ is closed to new replies.