Jump to content

date query


bcraig

Recommended Posts

Im using PHP and i want to select records from my database where the month within a date datatype field is equal to a set variable. I dont know if this is possible?

 

 

I have this now

$dateFormat = date('m');
$monthNo = 10;

$sql_month = sprintf("SELECT * FROM gigs WHERE '%s' = '%s'", $dateFormat, $monthNo);

 

But that shows all records dated with all different months in the database :(

 

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