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'));
}
}
}
?>
Raiffeisen Bank is leading financial institution in Bosnia and Herzegovina.
I am Ersan J. Sano, husband, father, developer currently living in Sarajevo. This site aims to give you information about who I am and what I do.