Jump to content

selecting date correctly


jeff5656

Recommended Posts

I am trying to select records with today's date but am getting zero hits:

$currdate= date("y-m-d");
$query = "select id from table1 where some_date = '$currdate'

 

the problem is that the date is stored as a datetime so there is a time after it.

How do I modify the above query to select for today's date and ignore the time part?

 

 

Link to comment
https://forums.phpfreaks.com/topic/265869-selecting-date-correctly/
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.