troubleshooting Question

Update MySQL field to change smart quote to straigth quote

Avatar of Victor Kimura
Victor KimuraFlag for Canada asked on
DatabasesMySQL ServerPostgreSQL
2 Comments1 Solution684 ViewsLast Modified:
Hi,

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
FROM
  products
WHERE
  products.product_descr LIKE '%’%'
  OR products.short_description LIKE '%’%'
  OR products.product_active_ingr LIKE '%’%'
  OR products.product_actives LIKE '%’%'

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,
Victor

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros