Re: MySQL: Return Number of Matched Rows
| From: | Yousif Masoud | Date: | Thu, 25 Mar 2010 21:54:02 +0000 |
| Subject: | Re: MySQL: Return Number of Matched Rows | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303480@lists.php.net to get a copy of this message | ||
On Thu, Mar 25, 2010 at 9:19 PM, James Colannino <james@colannino.org>wrote:
> Yeah, the extra select is what I was hoping to avoid :-P The MySQL
> client will return both the number of rows matched and the number of
> rows affected by the query; I was hoping perhaps the PHP API offered a
> way for me to do the same. Ah well... Thanks!
>
You can access data about the latest query via mysql_info()
http://php.net/manual/en/function.mysql-info.php
You can parse the string for the values you need.
There may be a more elegant solution.