July 21st, 1999, 10:06 AM
I'm developing a simple web application using php3 and mysql. My problem is the mysql date format. I'm using dates of the form
YYYY-MM-DD, just as mysql likes. The problem is if I make a query using a date in that same format, mysql does not match it up correctly with dates stored in the table. It only works if I ditch the delimiters like YYYYMMDD. I can work around the problem, but it's been bugging me why it won't work.
Any Ideas? Is it me?
PS Devshed ROCKS!!
September 9th, 1999, 12:52 AM
When inserting the current date, use the mysql CURDATE() function instead of PHP's date function. Use CURDATE() +0 to get YYYYMMDD instead of YYYY-MM-DD.