timmah1 Posted March 16, 2009 Share Posted March 16, 2009 I have a page that is suppose to show things according to date and time. The database has the startdate like Y-m-d, and the starttime like 10:00am, enddate like Y-m-d and endtime like 10:30am The problem I'm having is that right now, I have the starttime for today at 10:00am, so nothing should show since it is not 10:00am yet, but that article does. Am I doing this query right? <?php $Ddate = date("Y-m-d"); $Dtime = date("g:ia"); $query1 = "SELECT * FROM specials WHERE sport = '$sport' AND startdate = '$Ddate' AND starttime <= '$Dtime' AND endtime >= '$Dtime' ORDER BY 'id' ASC LIMIT 1"; ?> Thanks in advance Link to comment https://forums.phpfreaks.com/topic/149643-help-with-query/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.