ID: 41325
Updated by: [EMAIL PROTECTED]
Reported By: php-qa at sebastianmendel dot de
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: Windows / Linux
PHP Version: 5.2.2
New Comment:
I can't reproduce this with 5.0.27. I get the expected output of 1.
Do you have any other sort of special configuration or setting?
Previous Comments:
------------------------------------------------------------------------
[2007-05-08 14:50:46] php-qa at sebastianmendel dot de
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41325&edit=1