codeigniter last insert code example Example: codeigniter last insert id $last_inserted_id = $this->db->insert_id();