## Name
mysql_insert_id - returns the auto generated ID used in last statement

## Synopsis
```C
#include <mysql.h>

my_ulonglong mysql_insert_id(MYSQL * mysql);
```

## Description
Returns the auto generated ID generated by a SQL statement (usually INSERT) on a table for
a column defined with AUTO_INCREMENT attribute.

### Parameters:
`mysql` is a connection identifier, which was previously allocated by [mysql_init()](mysql_init) and connected by [mysql_real_connect()](mysql_real_connect).

# Return value
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.

## See also
* [mysql_query()](mysql_query)
