Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Get last insert ID

edited October 2010 in Vanilla 2.0 - 2.8
I made a request to insert the values into a table using the

$SQL = Gdn::SQL(); $SQL->Insert('Table', array('Field' => $var))

How can I get the last insert ID using the methods of framework Vanilla?
Thanks!
Tagged:

Comments

  • SS ✭✭
    edited October 2010
    Simple.
    SQL.Insert() returns last insert id.
    $LastInsertID = $SQL->Insert('Table', array('Field' => $var));
Sign In or Register to comment.