else if($('#operator').val() == "choose"){
                <?php  $terminal_query = "SELECT distinct Terminal from mytable";?>
                <?php  $terminal_result = $connect->query($terminal_query); ?>
                <?php  while ($terminal_row = mysqli_fetch_array($terminal_result)) 
                {
                ?>
                      $('#terminal').append('<option value='<?php echo $terminal_row["Terminal"]; ?>'>'<?php echo $terminal_row["Terminal"]; ?>'</option>');          
                <?php
                }
                 ?>
        }
I want to change MYSql query depends on the selected options
 
    