Things I would like to do before death
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'));
}
}
}
?>
Betmen
http://historijagradacac.blogger.ba/
.............................................................