Jump to content

compare dates


denoteone

Recommended Posts

I was given a csv file with a column for dates. they are in this format:

8/27/2008 12:49

 

i want to pass a variable in my url so that I can search by database so that I return everything from that date on.

 

so the url would be    www.mysite.com?date=08/01/2008

 

can i use that variable to search the date field in my database?

something like

$date = $_GET['date'];

$query = "SELECT *FROM tablename WHERE postDate >= '$date'";  
$result = mysql_query($query)or die (mysql_error());

 

 

Link to comment
https://forums.phpfreaks.com/topic/160528-compare-dates/
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.