I want to delete specific row from multiple mysql tables at a time. The tables have a common column.
I save the table names in an array like this :
$tables = array('table1','table2','table3','table4');
foreach($tables as $table) {
$query = $con->query("DELETE FROM $table WHERE Column='somevalue'");
}
if($query === FALSE) {
echo "Error : " . $query . $con->error;
}
Is this a way to delete rows from multiple tables at once? Please excuse me if this is a silly question. I am not an expert in PHP and MySql..