title: Insert Multiple rows of mysql using php
body: <p>How can I insert multiple data to mysql database using php. I tried using for loop but no luck.</p>
  
  <pre><code>//array of input boxes
  $id1=array($aa1,$aa2,$aa3,$aa4,$aa5,$aa6,$aa7);
  $timeRank1=array($a3,$a6,$a9,$a12,$a15,$a18,$a21);
  for ($i = 0; $i &lt; 7; $i++) {
  require_once("connection.php");
  $a = $id1[$i];
  $b = $timeRank1[$i];
  $sql = "INSERT INTO results (id,swim_rank)
  VALUES ('".$a."','".$b."')";
  </code></pre>