In a SQL prompt you could do
UPDATE [table_name] SET [field_name] = REPLACE([field_name],'[string_to_find]','[string_to_replace]');
Replace the [stuff] including the [] with the tables you want to effect and the fields...
So
UPDATE node_revisions SET body = REPLACE(body, ‘Red’, ‘Blue’);
Would replace all Reds with Blues in the table node_revisions and the field body.
BACK YOUR DATABASE UP BEFORE YOU TRY THIS!
--
Mike Bishop
Digital Mercenary
ADAMSON ADVERTISING
P. 314.727.9500 x 1237
M. 314.537.6723
From: sessy <sessy@citromail.hu>
Reply-To: <support@drupal.org>
Date: Wed, 13 Jun 2007 23:45:33 +0000
To: <support@drupal.org>
Subject: Re: [support] Search and Replace
A fast solution is to dump the database into an .sql file, and do a search&replace on it.
Another method would be to do a mysql update using the replace function:
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
regards,
s
Wed, 13 Jun 2007 10:17:30 -0400 -n
"A-NO-NE Music" <madflute@anonemusic.com> írta:
> I finally made the site live last night by modifying htaccess, only to
> find path written in node bodies are all wrong. Where it says:
> src/href="sites/..
> It should had said:
> src/href="/sites/..
>
> There are million places I have to edit. How can I do this Search and
> Replace in one shot?
--
[ Drupal support list | http://lists.drupal.org/ ]