Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45742 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83689 invoked from network); 12 Oct 2009 15:03:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Oct 2009 15:03:49 -0000 Authentication-Results: pb1.pair.com header.from=jille@hexon.cx; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jille@hexon.cx; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hexon.cx from 82.94.237.14 cause and error) X-PHP-List-Original-Sender: jille@hexon.cx X-Host-Fingerprint: 82.94.237.14 mulgore.hexon-is.nl Linux 2.6 Received: from [82.94.237.14] ([82.94.237.14:53218] helo=mulgore.hexon-is.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/55-54920-25543DA4 for ; Mon, 12 Oct 2009 11:03:47 -0400 Received: from adidas.hexon-nijmegen.nl (gw.hexon-nijmegen.nl [82.93.241.107]) by mulgore.hexon-is.nl (8.14.1/8.14.1) with ESMTP id n9CF3RZr014836 for ; Mon, 12 Oct 2009 17:03:27 +0200 Received: from [10.0.0.142] (HENK.hexon-nijmegen.nl [10.0.0.142]) by adidas.hexon-nijmegen.nl (8.14.3/8.14.3) with ESMTP id n9CF3QH8023533 for ; Mon, 12 Oct 2009 17:03:26 +0200 Message-ID: <4AD34538.8050202@hexon.cx> Date: Mon, 12 Oct 2009 17:03:20 +0200 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Hexon-MailScanner-Information: Please contact the ISP for more information X-Hexon-MailScanner-ID: n9CF3RZr014836 X-Hexon-MailScanner: Found to be clean X-Hexon-MailScanner-From: jille@hexon.cx X-Hexon-MailScanner-Watermark: 1255964608.13218@wBQHhg3GnV2bcQ9Sa+lu1A Subject: [patch] mysql_warning_count() for ext/mysql From: jille@hexon.cx (Jille Timmermans) Hello all, Not sure whether this is the right place to post; but it seemed a little bit better than php-db@. I have 'implemented' MySQL's mysql_warning_count() function. ( http://dev.mysql.com/doc/refman/5.1/en/mysql-warning-count.html ) mysql_warning_count() is available in MySQL's C-api in >3.23, >4.1 and >5 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(). 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. -- Jille