count frequancy between dates!
Posted: Fri Jan 28, 2005 10:22 am
i want to know how i would show the number of booked rooms each day over a given period.
$datein="2005-02-05";
$dateout="2005-02-09";
i tried array_count_values but didnt work.
MY Database table:
+----+--------------+---------------+
+ id.+ ..bookdate + enddate +
+----+--------------+---------------+
+ 1. + 2005-02-05 + 2005-02-06 +
+----+--------------+---------------+
+ 2. + 2005-02-05 + 2005-02-07 +
+----+--------------+---------------+
+ 3. + 2005-02-05 + 2005-02-08 +
+----+--------------+---------------+
the output i woud like would be like below:
-- 2005-02-05 -- 2005-02-06 -- 2005-02-07 -- 2005-02-08
_______3___________2___________1___________0____
please help!
$datein="2005-02-05";
$dateout="2005-02-09";
i tried array_count_values but didnt work.
MY Database table:
+----+--------------+---------------+
+ id.+ ..bookdate + enddate +
+----+--------------+---------------+
+ 1. + 2005-02-05 + 2005-02-06 +
+----+--------------+---------------+
+ 2. + 2005-02-05 + 2005-02-07 +
+----+--------------+---------------+
+ 3. + 2005-02-05 + 2005-02-08 +
+----+--------------+---------------+
Code: Select all
$query = "select * FROM rooms WHERE bookdate < '$dateout' AND enddate > '$datein'";-- 2005-02-05 -- 2005-02-06 -- 2005-02-07 -- 2005-02-08
_______3___________2___________1___________0____
please help!