php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47979 mysqli_insert_id return mixed, not int
Submitted: 2009-04-16 03:33 UTC Modified: 2009-04-21 00:36 UTC
From: surfchen at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Mac OSX
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: surfchen at gmail dot com
New email:
PHP Version: OS:

 

 [2009-04-16 03:33 UTC] surfchen at gmail dot com
Description:
------------
mysqli_insert_id return string when the result greater than the max_value of signed int. But the document http://www.php.net/manual/en/mysqli.insert-id.php says it return int, not mention the possibility of returning string.

Reproduce code:
---------------
CREATE TABLE `bigint_test` (
  `id` bigint(20) NOT NULL auto_increment,
  `vv` varbinary(100) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8589934592;
$l->query('INSERT INTO bigint_test (`vv`) values ("ii")');
var_dump($l->insert_id);

Expected result:
----------------
mixed mysqli_insert_id  ( mysqli $link  )

Actual result:
--------------
int mysqli_insert_id  ( mysqli $link  )

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-21 00:36 UTC] fa@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Jun 16 04:00:01 2026 UTC