title: Insert multiple values in one column mysql?
body: <p>I have a table of checkboxes and values, if a user selects a checkbox they select the value of the id in an array called checkedHW for simplicity sake this is what code looks like:</p>
  
  <pre><code>$ids = implode(',',arrayofids);
  
  $sql = "insert into table(id, type) values($ids,type);
  $db-&gt;query($sql);
  </code></pre>
  
  <p>echo query for testing:</p>
  
  <pre><code>"insert into table('id1,id2','type')
  </code></pre>
  
  <p>I figured that if I loop through this query I could hypothetically do this:</p>
  
  <pre><code>"insert into table('id1','type');"
  
  "insert into table('id2','type');"
  </code></pre>
  
  <p>but I'm not exactly quite sure how to do, any help would be wonderful :)</p>
  
  <p>I actually solved it using:</p>
  
  <pre><code>for($i=0;$i&lt;count(arrayofids); $i++){
  $sql = "insert into table(id,type) values(array[$i], 'type'";
  $db-&gt;query($sql);}
  </code></pre>
  
  <p>I hope that helps someone and thank you guys for the help!</p>