Suppose I have the following MySQL data
- userfiles/user/JohnSmith/2013_Thanksgiving_Final.jpg
- userfiles/user/JaneJohnson/2013_Thanksgiving_Final.jpg
- userfiles/user/BobbyLee/2013_Thanksgiving_Final.jpg
Is there a way to change it to?
- globalfiles/2016_Thanksgiving_Final.jpg
- globalfiles/2016_Thanksgiving_Final.jpg
- globalfiles/2016_Thanksgiving_Final.jpg
I was thinking doing something like this?
UPDATE user__attributes SET value = REPLACE(value, REGEXP '2013_Thanksgiving_Final', 'globalfiles/2016_Thanksgiving_Final.jpg') WHERE value LIKE '%2013_Thanksgiving_Final%';
I was thinking if I used REGEXP, it would target the whole string, based off just a piece of it to replace? Though I threw an error attempting this.
Thanks!