Here is an effective method:
Since your records have result identifiers, I'm going to assume that they also automatically increase the number.
If so, you do it and still use insert_batch.
Here is what you do:
1. You take the number of elements that you insert:
$count = count($data);
2. Run the batch insert:
$this->db->insert_batch($table, $data);
3 . Get the first inserted batch id:
$first_id = $this->db->insert_id();
4. Add a counter (minus 1) to your insert ID to get the last record ID.
$last_id = $first_id + ($count-1);
! , , .
:
, , ; InnoDB , , .