Possible Duplicate:
MySQL date format
i have this date which i need to make a comparison but i need to do it since the query!
Now i have this query:
Select date WHERE date="$today"
Where $todayis in this format :dmY
how can i directly transform it into dmY aswell? the date field?
Something like:
Select date("dmY",date) WHERE date="$today"
I don’t know if this is even possible to do, but i guess it might be, so i’d appreciate a little help even if it’s simply, yes, it’s doable, no, it’s not!
I think where you are having issues is formating the php date to fit with what is been formated from your mysql_query
Here’s what i came up with.
I have created a simple code for you to handle this.
The Procedure is that i got today’s date from mysql using CURDATE() function of mysql and then format it and match the exisiting column on the table
MYSQL DATABASE
PHP CODE (FILE)
Try it out let me know if it worked out for you….