I have tables named 20161006_cost
and 20161006_area
. The tables' name prefix is from the date they were created.
Can they be deleted automatically with a trigger, if the system date is more than 24 hours from the tables date creation? Or maybe with SQL or PHP code.
database mysql
engine innodb
===========================
edited
found the query tho show the table name
$qdrop=mysqli_query($connect,"select TABLE_NAME,create_time
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'mydb'
and CREATE_TIME <='2016-10-07' and TABLE_NAME LIKE '2016%'
");
but i can't use fetch array to show it
while($data=mysqli_fetch_array($qdrop)){
echo $data['TABLE_NAME'];
}
error code:
Fatal error: Cannot use object of type mysqli_result as array in E:\xampp\htdocs\....