I have 2 tables in MySQL.
Table1 holds fresh records all the time so it gets Truncated before new records are added.
Table2 hold a history of all the records Table1 has had so I copy records from Table1 to Table2 and then Truncate Table1 and add fresh data.
My problem is that Table2 doesn't see to accumulate records...it always holds the same amount of records that Table1 has before Truncating.
I'm using this code:
$backuphistory=mysqli_query($con,"INSERT INTO `Table2` SELECT * FROM `Table1`");
What I'm I doing wrong?