is there a mysql command that will change a certain number of characters to something else?
the problem is someone scripted a lyrics script, except it takes each quote and makes it multiple quotes. i don't even know ow to fix it, but i want to at least update the database so it doesn't do '' instead of '
update lyrics set lyrics = replace(lyrics,'\(double apostrophes)','\(single quote)');
it gave me an error saying that \(double quotes)' is not a known command... SO i tried changing all the single quotes to semicolons then tried changing two semicolons (since '' would become ; back into single quotes but now they've simply dissappeard from my database all together
Originally posted by honging argh, when i tried to do
update lyrics set lyrics = replace(lyrics,'\(double apostrophes)','\(single quote)');
it gave me an error saying that \(double quotes)' is not a known command... SO i tried changing all the single quotes to semicolons then tried changing two semicolons (since '' would become ; back into single quotes but now they've simply dissappeard from my database all together
update lyrics set lyrics = replace(lyrics,'"',"'")
the first one : single quote + double quote + single quote,
the second one : double quote + single quote + double quote.
That way you don't need to escape the quotes.
Now in php that should be written as
$sql = 'update lyrics set lyrics = replace(lyrics,\\'"\\',"\\'")';
Bookmarks