I have a table with an auto_incrementing column that’s set as the primary key. Is it possible to get the number from this column after doing an insert with active record without having to run another query?
$payment = new Model\Payment;
$payment->userId = $userId;
$payment->item = $item;
$payment->state = 'I';
$insert_id =
$payment->save();
1 Answer