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