Hi all,
I am doing some search in which my requirment is to search between specific dates.
Like user can put start date and then end date. Once submit then it should find result between these two dates but how ever how can avoid not to show the empty end date value?
mysql search berween two date?[SOLVE]
Moderator: General Moderators
mysql search berween two date?[SOLVE]
Last edited by jayson.ph on Fri Sep 07, 2012 4:53 am, edited 1 time in total.
Re: mysql search berween two date?
So only a start date?
Code: Select all
if ($start and $end dates) {
date condition = "date field BETWEEN $start AND $end";
} else if (only $start) {
date condition = "date field >= $start";
} else { // only $end
date condition = "date field <= $end";
}
query = "SELECT ... WHERE $date condition";Re: mysql search berween two date?[SOLVE]
Thank you requinix-