|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-04-10 07:48 UTC] r dot bohnen at ips dot nl
[2014-04-10 07:53 UTC] requinix@php.net
-Status: Open
+Status: Feedback
-Package: MySQL related
+Package: MySQLi related
[2014-04-10 07:53 UTC] requinix@php.net
[2014-04-10 09:54 UTC] r dot bohnen at ips dot nl
-Status: Feedback
+Status: Closed
[2014-04-10 09:54 UTC] r dot bohnen at ips dot nl
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 05:00:01 2025 UTC |
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