stormx Posted June 21, 2008 Share Posted June 21, 2008 Is their a script to clear all the records in a database, I have some user history that regualy builds up on a table, I was thinking of putting it on a cron and basically clearing it all out every 24 hours. Is this possible? Thanks Link to comment https://forums.phpfreaks.com/topic/111242-solved-clear-every-record-from-a-database/ Share on other sites More sharing options...
lonewolf217 Posted June 21, 2008 Share Posted June 21, 2008 delete from <table name> where <column name> like '%' will work if there is any column with varchar content Link to comment https://forums.phpfreaks.com/topic/111242-solved-clear-every-record-from-a-database/#findComment-570927 Share on other sites More sharing options...
thebadbad Posted June 21, 2008 Share Posted June 21, 2008 <?php mysql_query("TRUNCATE TABLE `table_name`"); ?> Clears the table "table_name". Link to comment https://forums.phpfreaks.com/topic/111242-solved-clear-every-record-from-a-database/#findComment-570933 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.