Need Help in mysql Update query

Discussion in 'Databases' started by easyhostingplans.info, Nov 26, 2010.

  1. #1
    Hello,
    I want to update all posts in wordpress database.
    i want to change an id that is inserted in every post in my wordpress website.
    how can i change all with update query ?

    for example, if i have following line in all my posts
    "the id is id-000 and the password is pass-000"

    and i want to change id-000 to id-111, what should be the query ??
     
    easyhostingplans.info, Nov 26, 2010 IP
  2. easyhostingplans.info

    easyhostingplans.info Peon

    Messages:
    507
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Finally found out myself :)
    UPDATE wp_posts
    SET post_content = REPLACE(`post_content`,'id-000','id-111');
     
    Last edited: Nov 26, 2010
    easyhostingplans.info, Nov 26, 2010 IP