using mysql replace() to replace quotes??
Posted 28 August 2006 - 02:59 AM
the following sql code doesn't work when using quotes and doubles quotes, it must think they're syntax??
update TABLE set COLUMN = replace(COLUMN, OLD_VALUE, NEW_VALUE);
any ideas, i'm new to sql, maybe theres something i can put around the " saying that they are a string?
Posted 30 August 2006 - 10:10 PM
Posted 30 August 2006 - 10:19 PM
INSERT INTO table VALUES('This is a \" test');
Inserts: This is a " test
Looking at your post a little bit, I might understand your problem better.
UPDATE table SET column = replace(column, '\"', 'feet');
Does that sound plausible?
Posted 31 August 2006 - 12:20 AM
It seems like better practise to leave the database as standard data and then add/remove as needed the slashes by using php code.
Thanks for the tip though in putting the backslash before the " in the replace function.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users