After calling the execute()
method on the Prepared Statement, the id of the insert row will be in the insert_id
attribute.
$pstm->execute();
$pstm->insert_id;
More Related Contents:
- mysqli_stmt::bind_result(): Number of bind variables doesn’t match number of fields in prepared statement
- How to use mysqli prepared statements?
- MySQLi prepared statements error reporting [duplicate]
- Example of how to use bind_result vs get_result
- mysqli: can it prepare multiple queries in one statement?
- mysqli_stmt::bind_param(): Number of elements in type definition string doesn’t match number of bind variables
- using nulls in a mysqli prepared statement
- Is mysql_real_escape_string() necessary when using prepared statements?
- How to prepare statement for update query? [duplicate]
- Can I mix MySQL APIs in PHP?
- How to change mysql to mysqli?
- Best way to INSERT many values in mysqli?
- Call to a member function bind_param() on a non-object [duplicate]
- Call to a member function prepare() on a non-object PHP Help
- mysqli last insert id
- LIMIT keyword on MySQL with prepared statement [duplicate]
- Build SELECT query with dynamic number of LIKE conditions as a mysqli prepared statement
- How to call a MySQL stored procedure from within PHP code?
- MySQLi count(*) always returns 1
- Warning: mysqli_connect(): (HY000/2002): No such file or directory
- pdo prepared statements with wildcards
- Do I have to guard against SQL injection if I used a dropdown?
- Using Mysqli bind_param with date and time columns?
- PHP UPDATE prepared statement
- Insert multiple rows with PDO prepared statements
- Unknown database error in PHP but it exists in PHPMyAdmin
- Can I blindly replace all mysql_ functions with mysqli_?
- Get number of rows matched by UPDATE query with PHP mysqli
- How to use mysqli_query() in PHP?
- When should I close a database connection in PHP?