MySQL Forums
Forum List  »  InnoDB

How to handle ampersand and question mark in query?
Posted by: Hulo Beral
Date: July 26, 2008 09:33PM

I have a discussion board which I have moved to a separate server. There are several absolute references to URLs in the posts which I want to find out and change with a query.

The problem is that the URLs have ampersand (&) and Question mark (?) characters which are generating errors in the query. An example of what I intend to do is:

update `hulo_posts` set `post` = replace(`post`, ‘www.abc.com/?mforum=huloforum&’, ‘www.hulo.com/index.php?’);

So, I wish to change all instances of part of one URL to another. The other portions of the URL after & and ? will remain the same. But this query is generating errors, probably because the statement cannot handle ampersand and question marks. Escaping did not help.

How do I solve this problem and make the query work?

Thanks in advance for any help.

Options: ReplyQuote


Subject
Views
Written By
Posted
How to handle ampersand and question mark in query?
6606
July 26, 2008 09:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.