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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
28 + 21 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Sat May 18 12:01:32 2024 UTC