note 84625 modified in mysqli.insert-id by danbrown
| From: | danbrown@php.net | Date: | Tue, 22 Jul 2008 16:02:57 +0000 |
| Subject: | note 84625 modified in mysqli.insert-id by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142502@lists.php.net to get a copy of this message | ||
Watch out for the oo-style use of $db->insert_id. When the insert_id exceeds 2^31 (2147483648)
fetching the insert id renders a wrong, too large number. You better use the procedural
mysqli_insert_id( $db ) instead.
[EDIT by danbrown AT php DOT net: This is another prime example of the limits of 32-bit signed
integers.]
--was--
Watch out for the oo-style use of $db->insert_id. When the insert_id exceeds 2^31 (2147483648)
fetching the insert id renders a wrong, too large number. You better use the procedural
mysqli_insert_id( $db ) instead.
http://php.net/manual/en/mysqli.insert-id.php