Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
George Westrup: "I have saved so much time using your products. Also you are quick to respond to every question I have had. Thanks for the great support".
Gabriela Arsene: "MySQL PHP Generator is really excellent! A very useful, easy to use tool and above all it is free, saving a lot of time and money to a developer! Great job! Congratulations to all the people who work at this project".

More

Add your opinion

PHP Generator for MySQL online Help

Prev Return to chapter overview Next

GetLastInsertId

Returns the auto generated id used in the latest query (usually INSERT) on a table with an autoincrement column.

 

Signature:

function GetLastInsertId()

 

Example:

$sql = "INSERT INTO customer (first_name, last_name) VALUES ('John', 'Doe')";

$this->GetConnection()->ExecSQL($sql);

$lastInsertedCustomerId = $this->GetConnection()->GetLastInsertId();



Prev Return to chapter overview Next