数据表备份

//备份数据表
$time = time();
Db()->execute('CREATE TABLE table1_'. $time . ' LIKE table1');
Db()->execute('insert into table1_' . $time . ' select * from table1');

Db()->execute('CREATE TABLE table2_' . $time . ' LIKE table2');
Db()->execute('insert into table2_' . $time . ' select * from table2');

//清空原表
Db()->execute('TRUNCATE TABLE `table1`');

Db()->execute('TRUNCATE TABLE `table2`');

上一篇:推广自动化的波折


下一篇:linux-/ proc / pid / stat文件中的cstime错误