Need to update a feild in MySQL database

Discussion in 'MySQL' started by midwestbonsai, Nov 14, 2009.

  1. #1
    Here is the story:
    I have a phpBB fourm.

    I have been moving files around on my server, images that I have embedded in some posts.

    Is there a way to simply update old/url/of/file to new/url/of/file via phpMyAdmin?

    I know that the path is stored in the post_text column.

    thanks
     
    midwestbonsai, Nov 14, 2009 IP
  2. flamer

    flamer Peon

    Messages:
    757
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll have to browse each query and change it yourself. Or export that table and do the edits locally. Then upload it onto your mySQL. That is the only way it can be done.
     
    flamer, Nov 14, 2009 IP
  3. midwestbonsai

    midwestbonsai Well-Known Member

    Messages:
    402
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #3
    I can't just search for something and replace it within the database?
     
    midwestbonsai, Nov 14, 2009 IP
  4. midwestbonsai

    midwestbonsai Well-Known Member

    Messages:
    402
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #4
    What about something like this that I just found

    
    UPDATE table SET column = replace(column, 'old/url', 'new/url');
    
    Code (markup):
     
    midwestbonsai, Nov 14, 2009 IP
  5. flamer

    flamer Peon

    Messages:
    757
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That is what is meant by "edit it locally"
     
    flamer, Nov 14, 2009 IP
  6. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #6
    I am not yet getting exact requirement, but if its merely changing base path from A to B then your update query should do the trick, however before that you need to be certain of the changes and all possible combinations.
     
    mastermunj, Nov 15, 2009 IP
  7. midwestbonsai

    midwestbonsai Well-Known Member

    Messages:
    402
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #7
    Yes it is just changing the path to the file, the filenames are gong to stay the same.
    The problem is that these url's are within the post_text field in the database which stores the entire posts.
     
    midwestbonsai, Nov 17, 2009 IP