added last_insert_id() to get the $last_insert_id and made $last_insert_id and $query_result protected