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 "room":
+---+--------------+---------------+
+ 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:PHP Code:$query = "select * FROM room WHERE bookdate < '$dateout' AND enddate > '$datein'";
-- 2005-02-05 -- 2005-02-06 -- 2005-02-07 -- 2005-02-08 ---
---- 3 Booked ---- 2 Booked ---- 1 Booked ----- 0 Booked ----
please help!




Bookmarks