views:

10

answers:

1

Hi

Does anyone know how can I replace the "comment_author_url" field from all comments by running a SQL query?

for example if this field is http://google.com to replace it with "" (empty string)

+2  A: 

Use:

UPDATE your_table
   SET comment_author_url = ''
 WHERE comment_author_url = 'http://google.com'
OMG Ponies
thank you. it works :D
Alex
Nice answer. Quick and simple. Would make for a neato plugin with some regex matching. ;-)
hsatterwhite
@hsatterwhite: Swap `WHERE comment_author_url = ...` with `WHERE comment_author_url REGEXP ...` - there's [more info on MySQL's regex support in this documentation link](http://dev.mysql.com/doc/refman/5.1/en/regexp.html).
OMG Ponies
Thats pretty sweet. Thanks again for the link!
hsatterwhite