Thursday 15 April 2010

php - Why does my variable not find the right date in phpmyadmin sql, but if I search it manually it does -



php - Why does my variable not find the right date in phpmyadmin sql, but if I search it manually it does -

i have list of dates(y-m-d) stored in database, , there's user fills in datetime. php function below converts datetime succesfully date.

when run $date variable in query returns nothing, when utilize output (14-10-10) work.

$date = date("y-m-d", strtotime($starttime));

output converted datetime

string(8) "14-10-10"

the query use:

select datum `booking` datum "14-10-10";

i changed field "dates" date string in database. tried convert output different forms int in 141010.

in database, format of date field 'yyyy-mm-dd'

so instead of using $date = date("y-m-d", strtotime($starttime)); utilize $date = date("y-m-d", strtotime($starttime));

to convert date format

select datum booking datum="2014-10-10";

php mysql date

No comments:

Post a Comment