Jay B Tue Feb 15 14:00:07 -0500 2011

Subject: Timestamp column causes exceptions

Hi Kien,

Here's what I am trying to do:

Session_model::create( array('id' => $id, 'expire' => time(), 'session_data' => $sessiondata ) );

And the result:
Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message '23000, 1048, Column 'expire' cannot be null'

It appears to not cause an exception when a "date("Y-m-d H:i:s")" is passed, but that's not what I want.

What should I do?

Using PHP 5.3, PHP.activerecord Stable 1.0


Devi Mandiri Sat Feb 19 09:27:55 -0500 2011

assuming you're using mysql, don't use Timestamp:

`expire` int(10) UNSIGNED NOT NULL,

(1-1/1)