I’d not come across REPLACE as a MySQL function before. I’d always used a combination of concatination of LEFTs and RIGHTs and the occasional MID.

Unbelievable that I’d not found this function before…

SELECT REPLACE(fieldname, "look for", "replace with") FROM tablename;

So simple…

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.