在mysql IN语句中,我该如何解决这样的情况?

My code works fine, the only issue is that my user only can not search 11 word from the database if they backspace delete certain. Look at my SELECT IN statement, I only input 11 array because I only allow user enter 11 keyword, that make sense. However, I allow user to backspace to delete.So, if user backspace delete three, the system still will count those delete word. When the user enter the 8th word, the system count the three delete word and the enter word, system will not search the word after 8th word. I came up an idea, I manually enter $term_0 to $term_100. But I don't know if that will slow down the speed. I also think about jquery.length,but it cannot combine with php select statement. Do you have any better way to achieve what I want? Appreciate.

$( "#tag" ).on( "keydown", function( event ) {//search keyword
  $.ajax({
    url:'member_search.php',
    type:'POST',
    cache: false,
    data:{
      search_text: $(".result_tag").text()
    },
    success: function(data){
      $("#find_user").val(data);
    }
  });
});

//delete keyword
$(document).on("click", "img", function() {
  $.post("delete.inc.php", {
    tag : $(this).closest("span").text(),
    users_id : $("#users_id").val()
  },
  if ($(this).parent().remove()){ //remove the tag
  }
});
<?php  
$stm =$db->prepare("SELECT s.id, s.term, s.counter, os.user_id FROM sign s, object_sign os  WHERE s.id = os.sign_id AND s.term IN (:term_0,:term_1,:term_2,:term_3,:term_4,:term_5,:term_6,:term_7,:term_8,:term_9,:term_10) GROUP BY os.user_id order by COUNT(os.user_id) DESC ");

    $term_0="$term[0]";
    $term_1="$term[1]";
    $term_2="$term[2]";
    $term_3="$term[3]";
    $term_4="$term[4]";
    $term_5="$term[5]";
    $term_6="$term[6]";
    $term_7="$term[7]";
    $term_8="$term[8]";
    $term_9="$term[9]";
    $term_10="$term[10]";
    
    
    
    

    $stm->bindParam(":term_0", $term_0);
    $stm->bindParam(":term_1", $term_1);
    $stm->bindParam(":term_2", $term_2);
    $stm->bindParam(":term_3", $term_3);
    $stm->bindParam(":term_4", $term_4);
    $stm->bindParam(":term_5", $term_5);
    $stm->bindParam(":term_6", $term_6);
    $stm->bindParam(":term_7", $term_7);
    $stm->bindParam(":term_8", $term_8);
    $stm->bindParam(":term_9", $term_9);
    $stm->bindParam(":term_10", $term_10);
    
    
     
    $stm->execute();

?>

</div>