Results 1 to 3 of 3

Thread: Get actual rows affected after UPDATE

  1. #1
    Join Date
    May 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Get actual rows affected after UPDATE

    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

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2010
    Location
    UK
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Get actual rows affected after UPDATE

    Can you let us know how you get on with this as I use tiny MCE on several applications

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •