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