CheckBox Problem[Help] - Cannot insert to database
Posted: Mon Jun 02, 2008 11:48 pm
Hi, I`m newbie in php. I have this script, its no error. But no variabel was input into the database. Please Help.
This is the script :
<?
$id = $_POST['id1'];
$id2 = $_POST['id2'];
$sql = "INSERT INTO `mychoice` (`cek1`,`cek2`) VALUES ('".$id."','".$id2."')";
?>
<html>
<body>
<form action="cek.php" name="frm1" id="frm1" method="get">
<input name="id1" id="id1" type="checkbox" value="1">Test
<input name="id2" id="id2" type="checkbox" value="2">Test2
<label>
<input type="submit" name="Submit" value="Submit">
</label>
</form>
</body>
</html>
This is the script :
<?
$id = $_POST['id1'];
$id2 = $_POST['id2'];
$sql = "INSERT INTO `mychoice` (`cek1`,`cek2`) VALUES ('".$id."','".$id2."')";
?>
<html>
<body>
<form action="cek.php" name="frm1" id="frm1" method="get">
<input name="id1" id="id1" type="checkbox" value="1">Test
<input name="id2" id="id2" type="checkbox" value="2">Test2
<label>
<input type="submit" name="Submit" value="Submit">
</label>
</form>
</body>
</html>