Entry
With a mysql query how do you find all the information between two times (i.e. from date1 to date2)
Jul 16th, 2002 16:58
Dan Halbert, Kris Tidblom,
Suppose your table has a column called "date", and you have $begin_date
and $end_date with values like '2002-08-01' and '2002-09-30'. Then do
something like:
SELECT * FROM my_table WHERE date BETWEEN '$begin_date' AND'$end_date';
BETWEEN is inclusive - it includes both the beginning and end. This
is clearer but the same as:
... WHERE '$begin_date' <= date AND '$end_date' <= date;