From: phlcastro at gmail dot com
Operating system: Linux
PHP version: 5.2.4
PHP Bug Type: MySQLi related
Bug description: insert_id doesnt work with stored procedures
Description:
------------
I tired with stored procedures and it did not worked out.
here is what i tried:
$mysqli = connection1();
$mysqli->autocommit(FALSE);
$user = "call insert_user('hello', 'mypass','myemail')";
$mysqli->query($user);
printf ("New Record has id %d.\n", $mysqli->insert_id);
$mysqli->commit();
exit;
Output:
New Record has id 0.
which is not correct, may be problem is with stored procedures.
Reproduce code:
---------------
$mysqli = connection1();
$mysqli->autocommit(FALSE);
$user = "call insert_user('hello', 'mypass','myemail')";
$mysqli->query($user);
printf ("New Record has id %d.\n", $mysqli->insert_id);
$mysqli->commit();
exit;
Expected result:
----------------
the id number
Actual result:
--------------
0
--
Edit bug report at http://bugs.php.net/?id=42956&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42956&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42956&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42956&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42956&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42956&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42956&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42956&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42956&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42956&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42956&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42956&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42956&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42956&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42956&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42956&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42956&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42956&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42956&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42956&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42956&r=mysqlcfg