Good question. Query might be optimal solution for this.
I have give solutions using PHP here below as PHP tag specified by you
<?php
require("db_connect.php");
$tables = mysqli_query($con, "SHOW TABLES FROM dbname");
while ($row = mysqli_fetch_assoc($tables)) {
$table_name = $row["Tables_in_dbname"];
mysqli_query($con, "DELETE FROM $table_name WHERE `id`=3");
}
?>
OR
create one more table where you make daily entries for id
which needed to delete from all tables and everyday you might get the different list of id
to delete from all tables.
Below here i have created a table ids_to_delete
where i specified list of ids to be deleted.
<?php
require("db_connect.php");
//get ids from table where specified ids to be deleted
$ids = mysqli_query($con, "SELECT `id` FROM `ids_to_delete`");
$id_list = '';
//create ids list like 1,4,3,9,5,6,...
while ($row_id = mysqli_fetch_assoc($tables)) {
$id_list .= $row_id['id'] . ',';
}
$id_list = trim($id_list, ',');
$tables = mysqli_query($con, "SHOW TABLES FROM dbname");
while ($row = mysqli_fetch_assoc($tables)) {
$table_name = $row["Tables_in_dbname"];
mysqli_query($con, "DELETE FROM $table_name WHERE `id` IN ($id_list)");
}
//clear the ids_to_delete table
mysqli_query($con,"DELETE FROM `ids_to_delete`");
?>