downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mysqli_stmt::num_rows> <mysqli_stmt::get_warnings
Last updated: Fri, 20 May 2011

view this page in

mysqli_stmt->insert_id

mysqli_stmt_insert_id

(PHP 5)

mysqli_stmt->insert_id -- mysqli_stmt_insert_idGet the ID generated from the previous INSERT operation

Descripción

Estilo orientado a objetos

int $insert_id;

Estilo por procesos

mixed mysqli_stmt::mysqli_stmt_insert_id ( mysqli_stmt $stmt )
Warning

Esta función no está documentada actualmente, solamente se encuentra disponible la lista de parámetros.



add a note add a note User Contributed Notes mysqli_stmt->insert_id
hgernhardt at tcnewengland dot org 07-Feb-2011 03:33
It should be noted that using mysqli_stmt->insert_id will not result in a unique ID being returned for each execution of a prepared insert statement.  In practice, it appears that the first insertion ID is returned.  If you are performing multiple inserts with the same prepared statement (one invocation of mysqli_stmt::prepare and multiple invocations of mysqli_stmt::execute() for a given statement), and need to keep the unique ID for each insert, use mysqli_connection->insert_id.
php at paulbutler dot org 31-Jul-2007 10:50
This can be used as a property of a statement as well:

<?php

$statement
= $mysqli->prepare($query);

echo
$statement->insert_id;

?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites