1mysql_stmt_insert_id(3)       MariaDB Connector/C      mysql_stmt_insert_id(3)
2
3
4
5   Name
6       mysql_stmt_insert_id  -  Returns  the auto generated id from previously
7       executed prepared statement.
8
9   Synopsis
10              #include <mysql.h>
11
12              my_ulonglong mysql_stmt_insert_id(MYSQL_STMT * stmt);
13
14   Description
15       The mysql_stmt_insert_id() function returns the ID generated by a  pre‐
16       pared  statement on a table with a column having the AUTO_INCREMENT at‐
17       tribute.  ## Parameter * stmt - a statement handle, which was previous‐
18       ly  allocated  by mysql_stmt_init(3).  ## Return value Returns the auto
19       generated id from previously executed prepared statement.  If the  last
20       query  wasn’t  an  INSERT  or UPDATE statement or if the modified table
21       does not have a column with the AUTO_INCREMENT attribute, this function
22       will return zero.
23
24   Notes
25       • When  performing  a  multi  insert prepared statement, mysql_stmt_in‐
26         sert_id() will return the value of the first row.
27
28   See Also
29       • mysql_insert_id(3)
30
31
32
33Version 3.2.2                                          mysql_stmt_insert_id(3)
Impressum