lets say this table
+--------------+---------------------------------+
| id | path |
+--------------+---------------------------------+
| 1 | http://old.com/img/1.png |
| 2 | http://old.com/img/2.png |
| 3 | http://old.com/img/3.png |
| 4 | http://old.com/img/4.png |
| 5 | http://old.com/img/5.png |
| 6 | http://old.com/img/6.png |
+--------------+---------------------------------+
what sentence will update it to
+--------------+---------------------------------+
| id | path |
+--------------+---------------------------------+
| 1 | http://new.com/img/1.png |
| 2 | http://new.com/img/2.png |
| 3 | http://new.com/img/3.png |
| 4 | http://new.com/img/4.png |
| 5 | http://new.com/img/5.png |
| 6 | http://new.com/img/6.png |
+--------------+---------------------------------+
i don’t know how to str_replace in mysql
"UPDATE table SET path = REPLACE(path, 'old.com', 'new.com')" ?? i can’t mess the database here..
If you’re worried about the effect of an update (and you should be), I do this first:
And I just eyeball the results to see if they “look OK”. If they do, if fire the update.