mysql date field

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rwahdan
Forum Newbie
Posts: 23
Joined: Thu Feb 12, 2009 1:49 am

mysql date field

Post by rwahdan »

Dear All,

i have a form where the user will enter the date as (dd/mm/yyy) formate then the user will click the submit button. the submit button onclick event will go to the database and check for all records that occured in the date that user entered but because mysql saves dates as (yyy-m-d) the query will result "0" records! how i can fo that?

Thanks.
rwahdan
Forum Newbie
Posts: 23
Joined: Thu Feb 12, 2009 1:49 am

Re: mysql date field

Post by rwahdan »

dear all,

i have found my problem!

i have to use this function to reformat the user input:
date('Y-m-d', strtotime($thestartdate));

thanks
Post Reply