title: How to use loop in insert's values in php
body: <p>I would like to use a loop in insert's Values. </p>
  
  <p>For example </p>
  
  <pre><code>$num = count($data);
  
  for ($c=0; $c &lt; $num; $c++) {
      echo $data[$c] . "&lt;br /&gt;\n";
  
  }
   $sql = "INSERT INTO $tbl_name VALUES (    '$data[$c]'   )";
  </code></pre>
  
  <p>If num is 5 then , then column will be created 5. which will be inserted 1 row with 5 columns. </p>
  
  <p>or 
  If num is 8 then , then column will be created 8. which will be inserted 1 row with 8 columns. </p>
  
  <p>In <strong>VALUES</strong>, How can i use loop or </p>
  
  <p>Since column number is not fixed. so How to insert column data dynamically which row will be created one(1).</p>
  
  <p>Please any suggestion? </p>