I have created an HTML form for check box:
<td>
<input type="checkbox" name="mode[]" id="mode" value="sweet"/>Sweet<br />
<input type="checkbox" name="mode[]" id="mode" value="sour"/>Sour<br />
<input type="checkbox" name="mode[]" id="mode" value="creamy"/>Creamy<br />
<input type="checkbox" name="mode[]" id="mode" value="bland"/>Bland<br />
</td>
This is action code for php page:
for ($i=0; $i<sizeof($mode); $i++)
{
$mode[$i] = mysql_real_escape_string($mode[$i]);
$query = "INSERT INTO frutesdetails(fruitname,fruitcolor,seasonfrom,seasonto,fruitetaste,fruitbenefit) VALUES ('{$fruitname}', '{$category}', '{$startdate}', '{$enddate}','.$mode[$i].','{$fruitbenefit}')";
}
$insertresults = mysql_query($query) or die(mysql_error());
?>
I am getting only one value of check box not all.