Basic wordpress based sql query help needed

I’m not big on SQL queries so could use a hand here..

In the wp_postmeta table I want to update all of the meta_value fields where the meta_key field is equal to either file_1, file_2 or file_3. I want to prepend the current content of meta_value with a string of text (string is currently image-1.jpg or similar).

Read More

I’m comfortable running a query through phpmyadmin. Any help greatly appreciated!

Related posts

Leave a Reply

2 comments

  1. You could try with:

    UPDATE wp_postmeta
    SET meta_value=CONCAT("image-1.png", meta_value)
    WHERE meta_key="file_1" OR meta_key="file_2" OR meta_key="file_3";
    

    Try it before. I didn’t test it.