title: how to build loop to insert array in a table
body: <p>i have the following code:</p>
  
  <pre><code> $var1="bmx"
   $newdata = implode(",", $dx);
   $queryinsert = "INSERT INTO table VALUES ($var1,$newdata)";
  </code></pre>
  
  <p>but with this code i get some like </p>
  
  <pre><code>INSERT INTO table VALUES (bmx,black,white, green, yellow,grey)";
  </code></pre>
  
  <p>and i need to create a new row for each color, like </p>
  
  <pre><code>INSERT INTO table VALUES (bmx,white)";
  INSERT INTO table VALUES (bmx,black)";etc...
  </code></pre>
  
  <p>i think i should use a foreach but i don't know how.</p>