I have mysql table with columns section
, is_date_based
(Yes/No values), date_start
, date_end
and showhide
query is
$query = "select * from tabele where section='Festival Wish' and ((is_date_based='No') OR (is_date_based='Yes' and (CURDATE() between date_start and date_end ))) and showhide='0' order by sort_order asc";
condition 1. : Now if is_date_based='No'
and showhide='0'
, row should be displayed...And IT IS WORKING....
condition 2. : But if id_date_based='Yes'
and if current date-time
is between date_start and date_end
and showhide='0'
, then and then only row should be displayed...
........
but unfortunately, condition 2 is not working even with required values and data in mysql table...
mysql table structure is
section is_date_based showhide date_start date_end
Festival Wish Yes 0 2018-09-01 05:00:00 2018-09-05 11:30:00
Festival Wish No 0 0000-00-00 00:00:00 0000-00-00 00:00:00
Here second record is shown, properly with above query, but first record is not shown even when current date is between date_start and date_end...