php date will not insert into mysql database
Posted
by
Piers Blinco
on Stack Overflow
See other posts from Stack Overflow
or by Piers Blinco
Published on 2012-09-05T15:17:36Z
Indexed on
2012/09/05
15:38 UTC
Read the original article
Hit count: 209
this is a strange one.
I have a date, that is converted to mm-dd-yyyy
when posting it to mysql i have re-ordered it to yyyy-mm-dd
but yet it still will not insert
$date = date("Y-m-d", strtotime($_POST['leaving_date']) );
any advice? Cheers
EDIT
The actual query:
mysql_query("INSERT INTO booking_info (customer_id, booking_ref, date_of_travel) VALUES (".mysql_real_escape_string($_POST['customer_id']).", ".mysql_real_escape_string($rnd).", ".mysql_real_escape_string($date).")");
© Stack Overflow or respective owner