#50041 [Opn->WFx]: [patch] mysql_warning_count() for ext/mysql
| From: | johannes@php.net | Date: | Fri, 30 Oct 2009 14:44:24 +0000 |
| Subject: | #50041 [Opn->WFx]: [patch] mysql_warning_count() for ext/mysql | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144102@lists.php.net to get a copy of this message | ||
ID: 50041
Updated by: johannes@php.net
Reported By: jille at hexon dot cx
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 5.3.0
New Comment:
The classic mysql extension won't get new features. For new features
please use mysqli, which already provides this functionality:
http://de.php.net/manual/en/mysqli.warning-count.php
Previous Comments:
------------------------------------------------------------------------
[2009-10-30 14:17:57] jille at hexon dot cx
Description:
------------
I have 'implemented' MySQL's mysql_warning_count() function. (
http://dev.mysql.com/doc/refman/5.1/en/mysql-warning-count.html
)
This function returns the number of warnings from the previous query.
In some queries (INSERT INTO .. VALUES (..), (..); INSERT INTO ..
SELECT; etc) mysql_info() was usable to return the number of warnings;
but for single-row inserts mysql_info() returns false.
The function is very straightforward, almost the same as
mysql_thread_id().
mysql_warning_count() is available in MySQL's C-api in >3.23, >4.1 and
>5
The patch is available at
http://jille.hexon.cx/mysql-warning-count.diff
It is based on PHP 5.3.0 and at least works for me.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50041&edit=1