Jump to content

Between two dates


dhope

Recommended Posts

Hi,

 

I currently have a simple mysql statement which pulls out all of the fields between two given dates. The statement works fine until you increase the end date.

 

Code...

 

$start_date  = "01/07/2011";

$end_date = "15/07/2011";

 

$result = mysql_query("SELECT * FROM sales WHERE sale_date BETWEEN '$start_date' AND '$end_date'");

 

-------

 

This works fine up until I increase the end date above the 15th then it seems to drag everything in regardless of the date.

 

Any ideas, is there anyway I can improve this code to make it work? 

 

Thank you :)

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