我想在该特定表格中添加新数据之前清除我的表格。
之后,在清除表之前,已经存在的数据必须移动到另一个表。
table1->Insert new data and move old data to table2
table2->old data of table1 + new data of table1
答案 0 :(得分:0)
应该是:
将旧数据移至table2
删除table1中的数据
在table1中插入新数据
根据您列出的步骤,表1和表2之间没有任何区别。
答案 1 :(得分:0)
试试这个:
$query = "Insert into table_2 Select * from table_1";
mysql_query($query);
mysql_query("Truncate table table_1");