[thelist] SQL question

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Tue Oct 5 13:00:40 CDT 2004


Hi Tom,

   What database are you using?  That will determine what functions are available to you.

In SQL Server, for example, you can do something like this:

UPDATE comments SET author = REPLACE(author, 'TSF', 'anonymous')

Cheers,

Peter Brunone 
______________
EasyListBox.com 

 From: Tom Dell'Aringa pixelmech at yahoo.com

Hello,

During a transfer to wordpress my comments all got borked with the wrong name/e-mail. I want to go
directly into the DB to fix this. 

I have the table 'comments' with the fields author and author_email.

What I want to do is REPLACE all occurances of 'TSF' in author with 'anonymous' 

and then

Replace all occurrances of my email with a blank or null. 

I not quite sure how to do a replace - and I don't want to try something and screw up my DB even
if I do have a backup! Any help is appreciated.

Tom


More information about the thelist mailing list