can anyone please guide me on How to insert a DATETIME filed from iphone through PHP script into MySQL database.
$dates = date('Y-m-d H:i:s','2010-10-12 15:09:00');
$query = "INSERT INTO timeTable(time) VALUES ('$dates')";
Thank you..
For date()
function as a second argument you should pass a timestamp.
$dates =date('Y-m-d H:i:s', strtotime('2010-10-12 15:09:00') );
But you have already your time in a good form sou you should just do:
$dates = '2010-10-12 15:09:00';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With