Ummm...are you SURE you want that???
If the comment was (example)
Code:
Look here: [ URL]http://www.zoo.com[/URL]
for more information
Then that replacement would give you
Code:
Look here: [ URL href='http://www.zoo.com[/URL]
for more information
Surely that is not what you are after???
But in any case, that's the wrong syntax for REPLACE in MySQL.
http://dev.mysql.com/doc/refman/5.5/...nction_replace
And then it works. Ugly, but works.
Code:
mysql> select * from comments;
+-----------------------------------+
| comment |
+-----------------------------------+
| Look here: {URL}www.zoo.com{/URL} |
+-----------------------------------+
1 row in set (0.00 sec)
mysql> update comments set comment = REPLACE(comment,'{URL}','{URL href=\'');
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from comments;
+-----------------------------------------+
| comment |
+-----------------------------------------+
| Look here: {URL href='www.zoo.com{/URL} |
+-----------------------------------------+
1 row in set (0.00 sec)
(I used { } because this forum won't let me override the meaning of [ URL] (without the space), but you can see it works.