Re: MySQL: Return Number of Matched Rows

From: Date: Thu, 25 Mar 2010 21:19:14 +0000
Subject: Re: MySQL: Return Number of Matched Rows
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-303478@lists.php.net to get a copy of this message
Floyd Resler wrote: > As for as I know, MySQL simply just doesn't report a row as being affected if nothing has > changed in it. To get the number of matched rows, try doing a SELECT query before you do the UPDATE > query. I don't know if that will produce the results you're looking for, but it might. > 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! James

« previous php.general (#303478) next »