I am creating a simple reservation calendar and I just have one question. What I want to do is color in cells on a table that have been reserved. The way we know whether or not they are reserved is by querying the mySQL database and retrieving a start date/time and a finish date/time. What I am doing now is adding a row in the database's table for each hour reserved and then having the table ask, through PHP, the database if that cell's hour has been reserved. I would like to make it possible to just have a start date/time and an end date time and have my PHP code determine if a certain time falls between those two values. If so, color in the cell.
Right now:
a b
c d
Cell a = if(hourA == $hourAFrommySQL){ color cell }
[...]
Ideally:
a b
c d
for all cells = if($startTimeAndDate < thisValue < $endTimeAndDate)
Anyone know how to do this? Anyone understand what I am saying? (sorry)
thanks
vs
PHP, mySQL Date Question
Moderator: General Moderators