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

Subscribe to our news:
Partners
Testimonials
Patrick Biegel: "Thanks a lot for your fast reply and the great solution! It works now and that's really important! The PHP Generator for MySQL is a great software".
Steven Langfield: "I wanted to drop you a mail to say how freaking AMAZING your software is. It will be the best £100 I have ever spent. I have still to read all your documentation to take full advantage but what you have created is truly amazing".

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