Yes using $this->db->insert_id() you can get the id of last inserted record in table.
Like this :
<?php
class InsertRecord extends CI_Model {
var $tablename = "test_table";
var $primaryID = "request_id";
function insertRecord(){
$insertArr['login_name'] = $_POST['login_name'];
$insertArr['login_password'] = $_POST['login_password'];
$insertArr['reg_date'] = $_POST['reg_date'];
$insertArr['status'] = $_POST['status'];
if ($this->db->insert($this->tablename, $insertArr)) {
$lastInsertedID = $this->db->insert_id();
}
}
}
?>
In $lastInsertedID variable you will get id of last inserted record.
Hope this will help you... :)