Get actual rows affected after UPDATE

Discussion in 'MySQL' started by php_techy, Apr 3, 2010.

  1. #1
    Hi,
    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?

    Regards
     
    php_techy, Apr 3, 2010 IP
  2. absorbation

    absorbation Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There is the PHP function mysql_info(); that should have this effect, although I have never used it myself:
    http://www.php.net/manual/en/function.mysql-info.php
     
    absorbation, Apr 4, 2010 IP