Welcome Guest, Not a member yet? Register   Sign In
Error when INSERT empty date on MySQL field with Active Record
#2

[eluser]Madmartigan1[/eluser]
Cast the value to integer.

Code:
$data['event_date'] = (integer) $this->input->post('event_date');

It will default to 0 if the value is empty.

EDIT: Sorry I use unix timestamps, I'm actually not familiar with the MySQL "date" type. I didn't read your post thoroughly.


Messages In This Thread
Error when INSERT empty date on MySQL field with Active Record - by El Forum - 03-24-2011, 11:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB