| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
SQL.MySQL.InsertID
For MySQL Connection queries the last insert ID.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| SQL | 2.9 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "SQL.MySQL.InsertID"; Connection ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| Connection | The connection reference number gained with SQL.NewConnection. | $Connection |
Result
Returns the ID or error message.
Description
For MySQL Connection queries the last insert ID.Please query value right after doing Insert. This value is reset when you call commit.
This needs columns with AUTO_INCREMENT.
see also
http://dev.mysql.com/doc/refman/5.1/en/mysql-insert-id.html
See also
Blog Entries
This function is free to use.
Created 18th August 2014, last changed 10th June 2026
MarkDown version: SQLMySQLInsertID.md