MySQL Forums
Forum List  »  Install & Repo

Help with selecting dates based on time
Posted by: John Robertson
Date: November 13, 2012 11:16AM

Hey I am new here and new to SQL in general. Basically I wrote a program for work where a user can enter in lunch meal's via php and then the data is displayed on the wall for other workers to look at it through out the day. Higher management wants the meal to display for the current day unless its after a certain time then they would like for the meal for tomorrow to display.

Right now my statement is:
select * from lunch where date = '$todaysdate'

$todaysdate is a variable held with the actual PHP page displaying the lunch meal for that day. How can I add to my select statement where if its after 1PM then tomorrows meal is displayed.

Options: ReplyQuote


Subject
Written By
Posted
Help with selecting dates based on time
November 13, 2012 11:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.