Home >Backend Development >PHP Tutorial >PHP implementation only keeps the latest 1000 records in mysql_PHP tutorial
This article mainly introduces the method and related examples and database structure of php implementation to retain only the latest 1000 records in mysql. It is very comprehensive, friends in need can refer to it.
?
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
mysql_select_db("test"); //Keep the latest 1000 records
|
1 2 3 4 5 | CREATE TABLE IF NOT EXISTS `news` ( `id` int(11) unsigned NOT NULL auto_increment, `title` varchar(256) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=gb2312; |