Avatar of Victor Kimura
Victor Kimura
Flag for Canada asked on

Update MySQL field to change smart quote to straigth quote


I have some fields in a table products which has some smart quotes (from Microsoft Word) in them and the smart quotes don't work well with Javascript. So is there a fast way to update the smart quotes and change them to straight quotes using MySQL only. I know I can do this with PHP but I'd like to see the code for doing it with MySQL code only.

I can do this and  receive 30 rows:
SELECT products.product_descr
     , products.short_description
     , products.product_active_ingr
     , products.product_actives
     , products.product_id
     , products.product_name
  products.product_descr LIKE '%’%'
  OR products.short_description LIKE '%’%'
  OR products.product_active_ingr LIKE '%’%'
  OR products.product_actives LIKE '%’%'

Open in new window

But I need a update one. For instance, the field product_descr contains this:
Able to hold skin’s moisture in balance through stressful shifts in humidity, like steamy exteriors and interiors parched by air conditioning. Never go thirsty again.

Notice the smart quote in skin's.

Thank you,

MySQL ServerPostgreSQLDatabases

Avatar of undefined
Last Comment
Victor Kimura

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Victor Kimura

Thank you.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck