Doc #69400 [Asn->Csd]: Wrong documentation for mysqli insert_id

From: Date: Mon, 03 Apr 2017 15:08:56 +0000
Subject: Doc #69400 [Asn->Csd]: Wrong documentation for mysqli insert_id
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14578@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69400&edit=1 ID: 69400 Updated by: peehaa@php.net Reported by: imbacen at gmail dot com Summary: Wrong documentation for mysqli insert_id -Status: Assigned +Status: Closed Type: Documentation Problem -Package: *General Issues +Package: Documentation problem Operating System: any PHP Version: Irrelevant Assigned To: peehaa Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2015-04-08 23:43:17] imbacen at gmail dot com Description: ------------ --- From manual page: http://www.php.net/mysqli.insert-id --- The documentation for mysqli insert_id is wrong. It says that function will return zero if query was not INSERT or UPDATE but in fact it will return the last inserted ID. The function seems to be just a wrapper for http://php.net/manual/en/function.mysql-insert-id.php where the documentation is correct and even warns that the value is NOT reset after each query. See discussion: http://stackoverflow.com/questions/29526374/mysqli-insert-id-still-returning-a-value-even-after-select-queries Test script: --------------- See: http://stackoverflow.com/questions/29526374/mysqli-insert-id-still-returning-a-value-even-after-select-queries Expected result: ---------------- It should state the same as docs for mysql_insert_id() ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69400&edit=1

« previous php.doc.bugs (#14578) next »