[PHP] MySQL: Return Number of Matched Rows

2010-03-25 Thread James Colannino
Hey everyone, I have a question. If I do a mysql query that updates a column in a row to the same value, I get 0 rows affected. However, I also get 1 or more matched rows. Is there a way that I can return the number of matched rows, rather than the number of rows affected? I'm trying to get

Re: [PHP] MySQL: Return Number of Matched Rows

2010-03-25 Thread Floyd Resler
On Mar 25, 2010, at 5:10 PM, James Colannino wrote: Hey everyone, I have a question. If I do a mysql query that updates a column in a row to the same value, I get 0 rows affected. However, I also get 1 or more matched rows. Is there a way that I can return the number of matched rows,

Re: [PHP] MySQL: Return Number of Matched Rows

2010-03-25 Thread James Colannino
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

Re: [PHP] MySQL: Return Number of Matched Rows

2010-03-25 Thread Yousif Masoud
On Thu, Mar 25, 2010 at 9:19 PM, James Colannino ja...@colannino.orgwrote: 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