Hi, actually i've tried the simple checkbox code but it doesn't work. My point is want to insert the selected checkbox value into the same database row.
Example : one,three --> if there are selected.
This is my code. Anybody can help me?
<?php
include 'connection/db_connect.php';
if(isset($one))
$val1=$one.";";
else
$val1=NULL;
if(isset($two))
$val2=$two.";";
else
$val2=NULL;
if(isset($three))
$val3=$three.";";
else
$val3=NULL;
$printVal=$val1."".$val2."".$val3;
$val=array($printVal);
if(isset($_POST['Submit'])) {
if($error ==0){
foreach($val as $values)
{
if(!empty($values)){
$sql="INSERT INTO `request` (detail) values('$values')";
mysql_query($sql);}
if (mysql_error()) trigger_error(mysql_error());
}
} }?>
<html>
<body>
<form name="frm" method="POST" action="<?php $_SERVER['PHP_SELF']; ?> " enctype="multipart/form-data">
<input name="one" type="checkbox" value="$one" /> One
<input name="two" type="checkbox" value="$two" /> Two
<input name="three" type="checkbox" value="$three" /> Three
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>