.\" Automatically generated by Pandoc 3.5 .\" .TH "mysql_insert_id" "3" "" "Version 3.3" "MariaDB Connector/C" .SS Name mysql_insert_id \- returns the auto generated ID used in last statement .SS Synopsis .IP .EX #include \f[B]\f[R] my_ulonglong mysql_insert_id(MYSQL * mysql); .EE .SS Description Returns the auto generated ID generated by a SQL statement (usually INSERT) on a table for a column defined with AUTO_INCREMENT attribute. .SS Parameters: \f[CR]mysql\f[R] is a connection identifier, which was previously allocated by \f[B]mysql_init(3)\f[R] and connected by \f[B]mysql_real_connect(3)\f[R]. .SH Return value Returns the value of the modified column with AUTO_INCREMENT attribute. If the table doesn\[cq]t contain an auto_increment column or no INSERT/UPDATE statement was executed, this function will return zero. .SS See also .IP \[bu] 2 \f[B]mysql_query(3)\f[R]