-
Notifications
You must be signed in to change notification settings - Fork 258
mysql_insert_id
Georg Richter edited this page Jun 11, 2021
·
1 revision
mysql_insert_id - returns the auto generated ID used in last statement
#include <mysql.h>
my_ulonglong mysql_insert_id(MYSQL * mysql);
Returns the auto generated ID generated by a SQL statement (usually INSERT) on a table for a column defined with AUTO_INCREMENT attribute.
mysql
is a connection identifier, which was previously allocated by mysql_init() and connected by mysql_real_connect().
Returns the value of the modified column with AUTO_INCREMENT attribute. If the table doesn't contain an auto_increment column or no INSERT/UPDATE statement was executed, this function will return zero.
MariaDB Connector/C Reference