• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • 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?

0
heavymark
Asked:
heavymark
  • 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
0
 
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.
0
 
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!

;-)

~Ray
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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