title: Php Mysql NOT IN array only affecting first result in array
body: <p>So I have a query to create an array of ID's that I do not want to be included in the data that populates my Select List. Both the select list and the array of excluded ID's are being pulled from a mysql database. The problem I am having is that when I echo out $exclude, it appears correctly in a comma separated list (1,2,3). However, when I attempt to add it in my NOT IN statement, it is only excluding the first number. I need it to exclude the entire array. Any ideas?</p>
  
  <pre><code>&lt;?php
  $excludeSql = "SELECT member_id FROM appointments WHERE joint_id = '$jointid'";
  $excludeData = mysql_query($excludeSql, $link);
  while($excluderow = mysql_fetch_array($excludeData)){
  
      $excludearray[] = $excluderow['member_id'];
  
                                }
  $exclude = implode(',',$excludearray);
  echo $exclude;
  ?&gt;
  &lt;select name="attendees[]"&gt;             
      &lt;option value=""&gt;--Select--&lt;/option&gt;
  
          &lt;?php 
          $memberSql = "SELECT id, firstName, lastName FROM members WHERE id NOT IN('".$exclude."') &amp;&amp; compid = '$compid' ORDER BY lastName ASC";
          $memberResult = mysql_query($memberSql, $link);
              while($memberRow = mysql_fetch_assoc($memberResult)){?&gt;
                  &lt;option value="&lt;?php echo $memberRow['id'];?&gt;" &gt;&lt;?php echo "".$memberRow['lastName'].", ".$memberRow['firstName'].""; ?&gt;&lt;/option&gt;
          &lt;?php } ?&gt;              
  &lt;/select&gt; 
  </code></pre>