title: MySQL Query: Select...Not In () in php
body: <p>I have a value of <code>$completedId="1,2,3,4,5";</code></p>
  
  <p>When I run this query in phpmyadmin, it gives the perfect output which is 6,7,8,9,10.</p>
  
  <p><code>select cmp_id from comprehension_master where cmp_id NOT in(1,2,3,4,5);</code></p>
  
  <p>But when I run the below given query in php, it shows output as <code>2,3,4,5,6,7,8,9,10.</code>
  Query only is being executed for value 1.</p>
  
  <pre><code>$completedId="1,2,3,4,5";
  $query="select cmp_id from comprehension_master where cmp_id NOT in('".$completedId."')";
  $result=$con-&gt;query($query);
  $cnt=0;
  while($row=$result-&gt;fetch_array()){
      $cmpId[$cnt]=$row[0];
      $cnt++;
  }
  $cnt=0;
  print_r($cmpId);
  </code></pre>
  
  <p>Please help me.</p>