diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 338e3ec6b..ca7ebf33d 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -255,9 +255,9 @@ class Update extends CI_Controller { } // Clear the tables, ready for new data - $this->db->empty_table("dxcc_entities"); - $this->db->empty_table("dxcc_exceptions"); - $this->db->empty_table("dxcc_prefixes"); + $this->db->query("TRUNCATE TABLE dxcc_entities"); + $this->db->query("TRUNCATE TABLE dxcc_exceptions"); + $this->db->query("TRUNCATE TABLE dxcc_prefixes"); $this->update_status(); // Parse the three sections of the file and update the tables diff --git a/application/models/Update_model.php b/application/models/Update_model.php index 3e0a4d646..28ff993ca 100644 --- a/application/models/Update_model.php +++ b/application/models/Update_model.php @@ -287,8 +287,7 @@ class Update_model extends CI_Model { } rewind($f); - $this->db->empty_table("lotw_users"); - $this->db->query("ALTER TABLE lotw_users AUTO_INCREMENT 1"); + $this->db->query("TRUNCATE TABLE lotw_users"); $i = 0; $data = fgetcsv($f, 1000, ",", '"', '\\'); do { @@ -564,8 +563,7 @@ class Update_model extends CI_Model { if ($http_result['http_code'] == "200") { $lines = explode("\n", $response); if (count($lines) > 0) { // Check if there was data, otherwise skip parsing / truncating the table and preserve whats there - $this->db->empty_table("hams_of_note"); - $this->db->query("ALTER TABLE hams_of_note AUTO_INCREMENT 1"); + $this->db->query("TRUNCATE TABLE hams_of_note"); $i = 0; foreach($lines as $data) { $line = trim($data);