View Full Version : Get actual rows affected after UPDATE

04-03-2010, 12:52 PM
I am using the following mysql query statement:

mysql_query("UPDATE inventory SET username='$username' WHERE username='$target->username' ORDER BY RAND() LIMIT 15");

now I want to also display to the user which rows were affected by the above query and list all those rows in an echo or something.

I know i can use mysql_affected_rows() to find HOW MANY rows were affected but can you make a script that will list the rows that were affected? or is it not possible?


04-03-2010, 10:07 PM
After looking a bit I can't seem to find anything. Depending on your needs you could obviously make a query that would find all rows of some type and just use that with he same criteria from your other query. A full solution would probably need to be part of the mysql architecture and not something added in php.

04-23-2010, 09:34 AM
Can you let us know how you get on with this as I use tiny MCE on several applications