title: php - How to insert looped value of checkbox into a single mysql_query
body: <p>I have here a looped value of checkboxes let's assume I have 3 increments</p>
  
  <pre><code>&lt;?php foreach ($times as $time) { ?&gt;
  &lt;input type="checkbox" name="b" id="b1" value=" &lt;?php echo $time-&gt;format('h:i a'), '-', $time-&gt;add($interval)-&gt;format('h:i a'); ?&gt;"&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>In the <code>foreach</code> it display 3 checkboxes that has different value.
  Now for example i checked 2 boxes. The query must run twice? Or better yet, the 2 checked value must be inserted to the db.</p>
  
  <pre><code>$b = $_POST['b'];
  $ins = mysql_query("INSERT INTO ehr_schedule3(`sched3_time) VALUES('$b')");
  </code></pre>
  
  <p>How can I do that?</p>