Ersan J. Sano - Home http://www.ersano.com/ eng Blog - MySQL database replace http://www.ersano.com/eng/Blog/b44/MySQL-database-replace.html Below script replaces some text, in column, with another in specified database on mysql server.
I am posting this as copy/paste reference sometimes in future...

<?php
mysql_connect('host','user','pass');
mysql_select_db('database');
$result_table = mysql_query('SHOW TABLES');
while ($row = mysql_fetch_array($result_table))
{
    foreach ($row as $key => $table)
    {
        $result_column = mysql_query('SHOW COLUMNS FROM $table');
        while ($row_column = mysql_fetch_array($result_column))
        {
            mysql_query(UPDATE $table SET $column = REPLACE($row_column['Field'], 'replace me', 'with me'));
        }
    }
}
?>
Blog Thu, 30 Dec 2010 06:28:26 +0100
Blog - Award http://www.ersano.com/eng/Blog/b43/award.html Blog Sun, 19 Dec 2010 14:54:27 +0100 Photos - Activities http://www.ersano.com/eng/Photos/a59/activities.html Photos Projects - Raiffeisen Bank Bosnia and Herzegovina website http://www.ersano.com/eng/Projects/p21/Raiffeisen.html Projects Raiffeisen Bank is leading financial institution in Bosnia and Herzegovina. Videos - Schnuffel http://www.ersano.com/eng/Videos/v35/Schnuffel.html Videos Sat, 12 Feb 2011 00:00:00 +0100