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.
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
<?php
if(isset($_POST['submit'])){
$checkBox = $_POST['mycheck_box'];
for($i=0; $i< sizeof($checkBox); $i++){
echo $query = "INSERT INTO check (quantity) VALUES ('".$checkBox[$i]."')";
echo "<br/>";
mysql_query($query) or die(mysql_error());
}
}
?>
Try
CHECK is a MySQL keyword when creating tables.
On a side note, you should be filtering any $_POST values you receive from a form before doing anything with a database.