where should I reset query after using get_results?

adding the following fixed the issue

 foreach($query as $sefer){
                $choices = array();
                $inputs = array();