Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: phranque
I have a full text field that is in a particular table. Does anyone know if there is a way to run a find and replace command on this field.
For info the field is lots of html text, and the text I want to change is a particular URL within this text.
Any syntax code would be greatly appreciated.
PS I have PHPMyAdmin nothing else to connect.
UPDATE table SET field1='somethingelse' WHERE field1='something';
As far as replacing just a portion of text with the field, I'm not sure if that is possible in MySQL or not. However, it would be very easy to do with a very short php or perl script.
The manual is your friend..
Gave me the following:
Which highlights this useful function:
So... the following should replace all instances of "foo" in your string with "bar":
UPDATE table SET field1=REPLACE(field1, 'foo','bar')
Hmm... it's a friday night and I'm making stupid programmer foobar jokes... gotta get out!