title: How to store checkbox values in db table
body: <p>I created a form with check boxes: </p>
  
  <pre><code>&lt;input type="checkbox" name="cars[]" value="Toyota" /&gt; Toyota
  &lt;input type="checkbox" name="cars[]" value="Honda" /&gt; Honda
  &lt;input type="checkbox" name="cars[]" value="Nissan" /&gt; Nissan
  </code></pre>
  
  <p>On the php part, I read the array and insert into it like this:</p>
  
  <pre><code>$carvalue = "";
  foreach($_POST['cars'] as $single){
      $carvalue .= $single;
      $carvalue .= ", ";
  }
  </code></pre>
  
  <p>I insert into my mysql db table the <code>$carvalue</code> variable separated values (eg Toyota, Honda, Nissan). Is this correct?</p>