note 117046 added to mysqli-stmt.insert-id
| From: | AurelienMarchand | Date: | Tue, 07 Apr 2015 15:59:44 +0000 |
| Subject: | note 117046 added to mysqli-stmt.insert-id | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202196@lists.php.net to get a copy of this message | ||
for those with zerofilled IDs beware as mysqli_stmt::$insert_id will return an integer. In other
words, if the ID returned from your query was #000099, the value produced by mysqli_stmt::$insert_id
is now #99.
I have not found a way to fix this beside using sprintf('%06d',$id) but this assumes you
know in advance the size of the ID beforehand.
----
Server IP: 216.235.13.26
Probable Submitter: 199.231.184.141
----
Manual Page -- http://php.net/manual/en/mysqli-stmt.insert-id.php
Edit -- https://master.php.net/note/edit/117046
Del: integrated -- https://master.php.net/note/delete/117046/integrated
Del: useless -- https://master.php.net/note/delete/117046/useless
Del: bad code -- https://master.php.net/note/delete/117046/bad+code
Del: spam -- https://master.php.net/note/delete/117046/spam
Del: non-english -- https://master.php.net/note/delete/117046/non-english
Del: in docs -- https://master.php.net/note/delete/117046/in+docs
Del: other reasons-- https://master.php.net/note/delete/117046
Reject -- https://master.php.net/note/reject/117046
Search -- https://master.php.net/manage/user-notes.php