function SetTable($table, $data) { $this->db->truncate($table); foreach($data as $d){ $this->insert($table, $d); } return true; }