phpMyAdmin search and replace
Here is a great tip that can save you hours of work. Sometimes you have messed up characters in your database - wrong character encodings - or you want to strip out some text in a certain table's field. In phpMyAdmin, open up the SQL dialog and use the following code (change tablename and tablefield to your name and field values):
UPDATE tablename SET tablefield = replace(tablefield, "findstring", "replacestring");
You can also tack on a WHERE statement, if you like.
I found this tip on Brian Zimmer's website.
Tested on MySQL5, PHP5 and phpMyAdmin 2.11.4.
You saved me hours!
I knew I'd seen an example on MySQL search and replace somewhere, but I couldn't remember where. A quick search on G and I found this page at the top with the answer I needed :)
Thanks!
Outstanding! Thank you!!!
Outstanding! Thank you!!!
Just what I was looking for .. thanks
15 min ago, I was bummed and sleepy, facing a task I didn't know how to do right off. One web search later I had the answer thanks to you and Zimmer. Thanks for posting a simple thing like this. Helps us newbies out a lot.
/sydney
Post new comment