Hello Please help me. I want to empty some tables of one of my databases every 1 hour. Now i want to create a php file and set cronjob for it to do it. But i dont know how to write codes for php file. I want it: For example i want that table1,table2 and table3 from database1 to be emptied every 1 hour. Please write php code for me. Thanks in advance.
Thanks a lot. But can you please write php code according to my example? table1,table2 and table3 from database1 to be emptied
you can create array for tabel names $tables=array("table1","table2","table3",...); foreach ($tables as $table) { mysql_query("TRUNCATE TABLE $table") or die(mysql_error()); }