Get Started

Upgrade

Where Syntax

Query

Aggregation

Fetch

Transaction

Management

Advanced

Raw object

PDO object

Debug

Information

version: 2.1.2

id

Return the ID for the last inserted row.

id($name)
Return: [string] The last inserted row ID.
$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();