0

I am trying to get data with multiple where condition but i do not where is problem .this query sending blank out put.any help.

 $user1 = $wpdb->get_results("select product,checked_by,submit_date,unit_data,temperature_in,temperature_out,time_in, time_out,category from diary_user_form_storage  where category_name='opening OR closing'  order by submit_date");
3

Your syntax for where is wrong it should be

$user1 = $wpdb->get_results("select product,checked_by,submit_date,unit_data,temperature_in,temperature_out,time_in, time_out,category from diary_user_form_storage  where category_name='opening' OR category_name='closing'  order by submit_date");
  • Sneha Agarwal@great, I just want perform AND operator replace of or . this answer is good thanks , can you change or with and – web query Oct 17 '17 at 9:58
  • Yes just have to replace OR with AND or you could also use the IN operator where category_name IN('opening','closing') – Sneha Agarwal Oct 17 '17 at 10:38
  • Sneha Agarwal@well thanks but when I used And instead of OR then its showing blank data, but right now i am working – web query Oct 17 '17 at 10:56
  • Are you you have data that satisfies the AND condition – Sneha Agarwal Oct 17 '17 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.