Changing all instances in column

Discussion in 'MySQL' started by deemainer, Mar 4, 2009.

  1. #1
    Hi all,

    In php admin, is there a way of changing all instances in a status field from say a number 1 to number 2?

    I have a link dir that i want to change the status flag on a table from a 1 to a 2 if that makes sense.I can search ok and get all the entries i need to change but cant work out how to globally edit a field.

    cheers
     
    deemainer, Mar 4, 2009 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Use UPDATE command e.g.

    UPDATE table_name SET
    status = 2
    WHERE status = 1
    Code (markup):
     
    mwasif, Mar 4, 2009 IP
  3. deemainer

    deemainer Active Member

    Messages:
    351
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    78
    #3
    THANK YOU !!!

    that saved me hours ! I had over 3000 links outstanding and id managed to clean out all the spam with search but couldnt work out how to approve in bulk.

    You are a star Mwasif.
     
    deemainer, Mar 4, 2009 IP
  4. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #4
    You are welcome!
     
    mwasif, Mar 5, 2009 IP
  5. alexpr07

    alexpr07 Active Member

    Messages:
    284
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #5
    nice solution :)
     
    alexpr07, Mar 5, 2009 IP