Bug #67053 [NEW]: php-mysqlnd returns 0 value on insert

From: Date: Thu, 10 Apr 2014 07:42:36 +0000
Subject: Bug #67053 [NEW]: php-mysqlnd returns 0 value on insert
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185160@lists.php.net to get a copy of this message
From: r dot bohnen at ips dot nl Operating system: CentOS release 6.5 (Final) PHP version: 5.5.11 Package: MySQL related Bug Type: Bug Bug description:php-mysqlnd returns 0 value on insert Description: ------------ When you insert and row within MySQL with the php-mysqlnd library you'll get an empty result set as result. Expected is; Inserted row id: {row number} Current is; MySQL returned an empty result set (i.e. zero rows). (Query took 0.0002 sec) Which means when you use: mysqli_query("INSERT INTO demo (demoid,demoname,demovalue) VALUES ('','name','value')"); and you want to have the inserted id (with mysqli_insert_id();) you will get NULL or 0 response, that's incorrect. When we use an older php-mysql or php-mysqlnd library than 5.5.10 (now using 5.5.11 and tried with 5.5.10, but that's also broken) it works as expected. Tested on multiple servers with same configuration. Test script: --------------- <?php $query = mysqli_query("INSERT INTO demo (demoid,demoname,demovalue) VALUES ('','name','value')"); $result = mysqli_insert_id(); echo $result; Expected result: ---------------- Returned ID Actual result: -------------- Null or 0 -- Edit bug report at https://bugs.php.net/bug.php?id=67053&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67053&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67053&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67053&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67053&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67053&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67053&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67053&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67053&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67053&r=support Expected behavior: https://bugs.php.net/fix.php?id=67053&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67053&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67053&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67053&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67053&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67053&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67053&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67053&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67053&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67053&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67053&r=mysqlcfg

« previous php.bugs (#185160) next »