title: compare array data with single column in database
body: <p>I need to check if the array stored data matches with the data present in the database. Meaning that, user will select check box data 1,4,5 which will be stored as <code>$data[]</code>. In database there is a table with a column <code>ID</code> which will have 1, 2, 3, 4, 5. Every time user selects different check box, which will be stored in <code>$data</code>. I want to check those values with the database ID and i want to get only those values which is stored in-front of that ID in other column called 'value'</p>
  
  <p>Example: if <code>$data</code> has value 3, 4, then it should get the value from the database only for 4 and 5.</p>
  
  <p>I am not getting how to do this comparison and get the value.</p>
  
  <pre><code>$query = "select values from customer where bname = '".$_POST['bname']."' ";
  
  $update = DB_query($query,$db);
  while($row = DB_fetch_array($update))
  {
      $array=explode(',',$row["values"]);
  }
  </code></pre>