$insert_data = array( 'username' => $value1, 'userpassword' => $value2, 'userfullname' => $value3, 'userstatus' => 1, ); $this->db->insert('tbluser',$insert_data); $last_id = $this->db->insert_id('tblphoto');