Welcome Guest, Not a member yet? Register   Sign In
insert date
#6

[eluser]winter[/eluser]
Sorry to resurect this thread. I've been trying to use CI's now() function or even PHP's time() function with CI's ActiveRecord to insert a date into a datetime field in a mysql table. The only way I could get it to work was doing:

$timenow = now();
$this->created = unix_to_human($timenow, TRUE, 'eu');
$this->db->insert('users', $this);

This is my first time using ActiveRecord. It's a bit confusing to me because of the various ways to do the same thing. I guess there might be a problem there. Because a plain SQL insert using NOW() worked fine.

Anyway, if anyone can let me know why I'm having issue, that would be nice. I'll use the above method for now.

Cheers!


Messages In This Thread
insert date - by El Forum - 12-30-2007, 04:14 PM
insert date - by El Forum - 12-30-2007, 07:56 PM
insert date - by El Forum - 12-30-2007, 09:00 PM
insert date - by El Forum - 12-30-2007, 11:17 PM
insert date - by El Forum - 12-31-2007, 02:30 AM
insert date - by El Forum - 04-19-2008, 12:32 AM
insert date - by El Forum - 04-19-2008, 02:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB