Inserting selected Checkbox value to the database
<p>This part of the code is fine i do not see any problem there but still i can not insert it to the data base the following message appears.</p>

<p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check (quantity) VALUES ('2')' at line 1</p>

<pre><code>&lt;?php
     if(isset($_POST['submit'])){
          $checkBox = $_POST['mycheck_box'];    
          for($i=0; $i&lt; sizeof($checkBox); $i++){    
          echo $query = "INSERT INTO check (quantity) VALUES ('".$checkBox[$i]."')";
          echo "&lt;br/&gt;";
                        mysql_query($query) or die(mysql_error());
          }
       }
    ?&gt;
</code></pre>
