ID:               49562
 Updated by:       u...@php.net
 Reported By:      jille at hexon dot cx
 Status:           Bogus
 Bug Type:         MySQL related
 Operating System: Linux
 PHP Version:      5.3.0
 New Comment:

Yes, you need to run SHOW WARNINGS or similar. If you want this to be
changed, please file a feature request at bugs.mysql.com. It is not a
PHP bug.


Previous Comments:
------------------------------------------------------------------------

[2009-09-21 10:04:41] jille at hexon dot cx

Can you tell me how to retreive the number of warnings without querying
'SHOW WARNINGS' ?
I think mysql_info() is the place where that should be available.

------------------------------------------------------------------------

[2009-09-17 11:47:45] u...@php.net

Please see http://bugs.php.net/bug.php?id=49573 for an explanation.

mysql_info() does not return anything for single-row INSERTs and that
is how it should be.

------------------------------------------------------------------------

[2009-09-16 07:34:50] j...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------

[2009-09-15 13:08:24] jille at hexon dot cx

Description:
------------
mysql_info() returns false when inserting only one row. This results in
the unability to retreive the number of warnings which might have
occurred.

if $numWarnings > 0 I would like to retreive the warnings with
mysql_query("SHOW WARNINGS"); but I'd prefer not doing that if there are
no warnings.

Reproduce code:
---------------
mysql_query("CREATE TABLE a (a VARCHAR(4))");
mysql_query("INSERT INTO a (a) VALUES ('abcde')");
var_dump(mysql_info());

Expected result:
----------------
Just like the mysql-CLI:

mysql> INSERT INTO a (a) VALUES ('abcde');
Query OK, 1 row affected, 1 warning (0.01 sec)

so something like "1 row affected, 1 warning" would be perfect

Actual result:
--------------
bool(false)



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49562&edit=1

Reply via email to