im trying to find and replace some string in all my rows in a database first i get all tables and loop through them and get all columns then i execute this query
if ($column_name !== 'id')
{
$replcace_q = $database->query("UPDATE $table_name SET $column_name = REPLACE('$column_name','$old','$new')") or die($database->error);
}
the loop is ok and i go to each table successfully but the result of executing the command is when it updates a column it replaces the content with the column name for example if column_name is username the content will change to username.
what am i doing wrong ?