php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50041 [patch] mysql_warning_count() for ext/mysql
Submitted: 2009-10-30 14:17 UTC Modified: 2009-10-30 14:44 UTC
From: jille at hexon dot cx Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.3.0 OS: Linux
Private report: No CVE-ID: None
 [2009-10-30 14:17 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-30 14:44 UTC] johannes@php.net
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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 20:01:29 2024 UTC