Scripts and functions that I have written or found useful

replace string in a table

October 17th, 2007 Posted in MYSQL

If you want to change certain rows in a database where a query applies … for example an “if” query finding all entries which contain “samplesearchtext”… then run the following script either via mysql/phpmyadmin/php

update mytable set myfield =replace (myfield, ’samplesearchtext’, ’samplereplacetext’);

Post a Comment