|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-08 15:07 UTC] scottmac@php.net
[2007-05-08 15:28 UTC] tony2001@php.net
[2007-05-08 17:17 UTC] php-qa at sebastianmendel dot de
[2007-05-08 18:27 UTC] php-qa at sebastianmendel dot de
[2007-05-20 10:22 UTC] ljbuesch at purdue dot edu
[2007-05-20 13:56 UTC] philip@php.net
[2007-05-27 23:55 UTC] ljbuesch@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 20:00:01 2025 UTC |
Description: ------------ issuing an insert statement that raises warnings mysqli_affected_rows() returns the warning count instead of inserted rows count tested with MySQL server 5.0, 5.1 and 5.2 (6.0) Reproduce code: --------------- // open db connection/select db //$mysqli = mysqli_... // create table $sql = 'CREATE TABLE `test` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `int` int(11) NOT NULL, `int2` int(11) NOT NULL, PRIMARY KEY (`id`) )'; mysqli_query($mysqli, $sql); // insert row $sql = 'INSERT INTO `test` (`int`, `int2`) VALUES ('', '');' mysqli_query($mysqli, $sql); echo mysqli_affected_rows($mysqli); Expected result: ---------------- 1 Actual result: -------------- 2