title: check array values exist in mysql table
body: <p>I need to check the array values which contains more than 400 values which is existing in the MySQL table where i should get result for all the values which I am passing even if it not exist in the column. </p>
  
  <p>for example: </p>
  
  <pre><code>cont table
  ----------
  Column1                  
  ---------             
  
  9xxxxxxxxx
  
  91xxxxxxxx
  
  92xxxxxxxx
  </code></pre>
  
  <p>my array contains <code>9xxxxxxxxx</code> &amp; <code>91xxxxxxxx</code>. How can i iterate to get the column exist or not.</p>
  
  <p>I tried with <code>foreach</code> and building query</p>
  
  <pre><code>$sql = 'SELECT cont WHERE num IN(';
  
  foreach($jsonString as $val){ 
  
  $sql = $sql . "'$val', ";
  
  echo $val;
  
  }
  
  if(mysqli_query($con,$sql)){  
      echo "exist";
  }else {
      echo "error";
  }
  </code></pre>
  
  <p>Is there any efficient way other than the above which is faster in time? </p>