How can I use this string replace in MySQL

I’m using WordPress and have a load of custom fields where I need to do a string replace on. Basically I have a price field which is in the example format:
from 113.800

I need to remove the word ‘from’, the space after it and the dot between the number. All the fields are in this format, how can I use a MySQL replace function to do this?

Read More

Thanks

Related posts

Leave a Reply

1 comment

  1. REPLACE() doesn’t support regular expression matching, so you’ll have to do it in a more clumsy way:

    UPDATE wp_sometable
    SET price_field = REPLACE(REPLACE(price_field, 'from ', ''), '.', '');