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

Subscribe to our news:
Partners
Testimonials
Kirby Foster: "Nice software. Small, lightweight, works well. I evaluated lots of software before deciding that your software worked the best for what I do. Both Maestro for MySQL and PHP Generator have saved me lots of time".
Ran Cole: "We bought the tool last week and want to say how much we love it. We've found it not only powerful, but very user friendly. We have used the tool to create an interface that manages our MySQL DB for different types of users".

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