• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

MySQL Find and Replace Characters

I need to do a find and replace mysql statement.

I wrote this statement to replace the odd characters with a single quote in table jos_content and row fulltext.

update jos_content set fulltext = replace(fulltext, 'â¬"', '\'')

I get an error. I have tried finding the html entities for each of the three characters and replacing them but still get an error. Anythoughts?

  • 2
1 Solution
Ray PaseurCommented:
How big is this table?  If it is less than a few million lines and you do not have to do this every few seconds, you might want to consider a PHP + MySQL solution.

Also, "I get an error." is not a standard message that I recognize.  We can have a better chance of helping you if you show us the inputs, your code, the outputs and tell us about your desired outputs.

Best regards, ~Ray
heavymarkAuthor Commented:
Actually I ran the same update query as listed above in Navicat instead of PhpMyAdmin and it works. It seems Navicat has built in functionality to handle the odd characters.

I did not provide the exact error message, because it was not relevant to the solution. That its simply a matter of not being able to use those characters mentioned above in the update query. Such as not being able to use a single quote without using an a escape \. So I was simply looking for the way to "escape" or encode those particular characters as I have seen the same question all over the internet.

But once again, pasting the same query in Navicat's does all the user to run any and all of the odd characters I have come across rather than exporting the database and changing them in a local application and then reuploading.
Ray PaseurCommented:
"I did not provide the exact error message, because it was not relevant to the solution."

Wow, I wish the developers who write software could know they were wasting their time working on error messages.  Think of the time we could all save if we didn't need the error messages!


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now