Jump to content

Help with Query


timmah1

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.