When i try to save data to my model Doctrine throws this exception:
Message: Couldn't get last insert identifier.
My table setup code is:
$this->hasColumn('id', 'integer', 4, array(
'type' => 'integer',
'length' => 4,
'fixed' => false,
'unsigned' => false,
'primary' => true,
'autoincrement' => true,
));
Please help. Thanks.
Check to make sure that the column in your database is set up as auto_increment. It looks like the Doctrine class is handling it as an auto_increment but it's not set up as such in the DB.
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