DB Plugin : is there a way to fetch a "LAST_INSERT_ID()" value ?

1 view
Skip to first unread message

Kure

unread,
Dec 11, 2009, 6:17:18 AM12/11/09
to atomikframework
Hello everybody !

I'm new to Atomik Framework, and I have a little problem : I don't
know how to make a "SELECT LAST_INSERT_ID()" request on my database.

Do you have an idea ?

Thanks, Kure

(Sorry for english...)

Kure

unread,
Dec 11, 2009, 5:42:48 PM12/11/09
to atomikframework
It works this way :

[CODE]

Atomik_Db::insert('table', $values);
$last_ids=Atomik_Db::query('SELECT LAST_INSERT_ID()');
foreach($last_ids as $lid){
$last_id=$lid[0];
}

[/CODE]


Kure
Reply all
Reply to author
Forward
0 new messages