Jump to content

Between Date Range


timmah1

Recommended Posts

Why is this not working?

$result = mysql_query("SELECT * FROM contacts WHERE type = 'consumer' AND sent BETWEEN '".date("Y-m-d")."' AND '".date("Y-m-d", strtotime("-7 days"))."'") 
or die(mysql_error());
$numrows = mysql_num_rows($result);
if($numrows < 0 ){
	echo "No records found";
}

 

The record that is stored in the sent column is like this "2011-11-03 14:42:12", so there is a record in there, but nothing is showing up.

 

Can anyone see why?

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/250573-between-date-range/
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.