function Insert($table, $data) { $this->db->insert($table, $data); $newId = $this->db->insert_id(); return $newId; }