Search Posts

I am trying to fetch data by selected date

I am trying to fetch data by selected date. I have callender and trying to get data on date click. In my loop I am getting data on current date.but to much confuse how I can get data, By Each date.
Here is my query.

$user1 = $wpdb->get_results(
    "select product,checked_by,submit_date from diary_user_form_storage where DATE(submit_date) = CURDATE() ;

foreach ($user1 as $key => $value) {
    $date1 = date('Y-m-d',strtotime($date));
    $timing= date('H:i:s',strtotime($date));

In this query all data coming by current date. And I am trying to fetch by date.

Source: Stackoverflow

Leave a Reply

Your email address will not be published. Required fields are marked *