Forum Moderators: coopster

Message Too Old, No Replies

Is it possible to retrieve data based on its date?

         

judgenules

8:18 am on Oct 28, 2007 (gmt 0)

10+ Year Member



Hello,

I have been searching everywhere on the net on how to retrieve data based on the dates. for eg. today's date. Is it possible to do this? If yes, how can it be done?

Thank u!

Habtom

8:26 am on Oct 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If yes, how can it be done?

Since this is a PHP forum, I will show you how you can write the SQL query with an input from PHP.

Formatted current date:
$mydate = date("d-m-Y");

OR

if you have saved the date on timestamp:
$mydate = time();

mysql_query("SELECT * FROM table1 WHERE mydate = '". $mydate ."'")

Habtom