Version: v2.4.0
id
Return the ID of the last inserted row.
id($name)
name [string] (optional)
The name of the sequence object. When provided, this returns the last value generated for that sequence.
Return Value
[string] The last insert ID as a string.
$database->insert("account", [
"user_name" => "foo",
"email" => "foo@bar.com",
"age" => 25
]);
$account_id = $database->id();
For Oracle
$database->insert("ACCOUNT", [
"NAME" => "foo"
], "ID");
$account_id = $database->id();