PHP, mySQL Date Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
victorysshadow
Forum Newbie
Posts: 1
Joined: Wed Nov 10, 2004 5:43 pm

PHP, mySQL Date Question

Post by victorysshadow »

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
dreamfly
Forum Newbie
Posts: 3
Joined: Wed Nov 10, 2004 9:01 pm
Contact:

Post by dreamfly »

i don't understand your meaning really .
Post Reply