Jijo schreef:
hi ,

  can anybody help me how to get last inserted id from database.I have used
lastInsertId() method.But its not working

Regards,
Jijo Anthony.


Hi,

If your table is defined with an auto-incrementing primary key, you can call the |lastInsertId()| method after the insert. This method returns the last value generated in the scope of the current database connection.

For example:

$db->insert('bugs', $data);

// return the last value generated by an auto-increment column
$id = $db->lastInsertId();

Best,

--
Andries Seutens
http://andries.systray.be

Gecontroleerd op virussen door de JOJO Secure Gateway.

Reply via email to