Jump to content

using the date function in a mysql query?


runnerjp

Recommended Posts

What type of values are in your date column?

 

For what you posted, the mysql date() function expects a value or column that is either a DATE or DATETIME. If you are trying to use the php date() function, you would need to break out of the SQL query string so that php would parse the function call instead of mysql parsing it.

 

You can also only compare dates when the parts of the date are ordered left to right, most significant digit (year) to least significant digit (day), and the length of each corresponding field in the two values being compared is the same.

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.