Trouble inserting date in to datetime field |
[eluser]kyleect[/eluser]
I'm having trouble inserting the date from a form field in to the datetime field of my table. The code below takes any date string from the form and inserts it as '0000-00-00 00:00:00'. The `date` field is listed as a datetime field in MySQL. Can someone see something I'm overlooking for why this doesn't work? Thanks! Model methods from MY_Model: Code: protected function convert_date_to_sqldate($date) Code on page: Code: $insert_data = array(
[eluser]Georgi Budinov[/eluser]
Perhaps your problem is here ![]() Code: protected function convert_date_to_sqldate($date) to Code: protected function convert_date_to_sqldate($date) Check this http://php.net/manual/en/function.date.php
[eluser]kyleect[/eluser]
I changed i to s because the manual said i was minutes. It worked! Thanks. |
Welcome Guest, Not a member yet? Register Sign In |