Page 1 of 1

mysql date field

Posted: Tue Mar 17, 2009 11:46 pm
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.

Re: mysql date field

Posted: Wed Mar 18, 2009 1:06 am
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