title: one row insert into mysql from a loop php
body: <p>I have a loop where I need to get the elements and then I need to insert each element in mysql table but this code is able to insert only 1 element.(p.s. The variable is loaded with min 4 element).</p>
  
  <p>Why I'm not able to insert multiple element with this loop?</p>
  
  <p>Please I need it to know urgently.Thanks</p>
  
  <pre><code>function addmijloc(){
  
  foreach ($_SESSION["mijloc"] as $check)
  {
  $sql="INSERT INTO isu_mijloace (`nr_rap_ext_mijl`, `mijloc`) VALUES ('".$_SESSION['nrraport']."', '".$check."')";
  if(mysql_query($sql)) 
      {
      $mijloace="ok"; 
      }
      else
      {
      echo '&lt;script&gt;alert("Tabela mijloace eronata");&lt;/script&gt;';  
      }
  }
  }
  </code></pre>