I have displayed check box values(ugroup field) from ugroups table.now what i want to do is,when user select multiple check boxes and submit it should be insert into relavent feild in table.now it’s insert check boxes values.but not in relevant field.this is my code.Please help me.
[php]
//select ugroup’s from group table.
$result = “SELECT id,ugroup FROM group”;
$res_result = db::getInstance()->query($result);
[/php]
[code]
Tittle :
Description :
//Display ugroups in textboxes and checkboxes
<?php
while( $line=$res_result->fetch(PDO::FETCH_ASSOC)) {
echo ‘’;
echo’<input type=“text” name=“ugroup” disabled=“disabled” value=" ‘. $line[‘ugroup’] .’" size=“7” "/>’;
echo ’ ';
}
?>
db_add_page.php
[php]if(isset($_POST))
{
$tittle = $_POST[‘tittle’];
$description = $_POST[‘description’];
$ugroup = $_POST[‘group’];
$acc_status = “INSERT INTO add_services (id,tittle,description,g1,g2,g3,g4,g5,g6,g7,g8)
VALUES(NULL,’”.$tittle."’,’".$description."’,’".$ugroup[0]."’,’".$ugroup[1]."’,’".$ugroup[2]."’,’
“.$ugroup[3].”’,’".$ugroup[4]."’,’".$ugroup[5]."’,’".$ugroup[6]."’,’".$ugroup[7]."’)";
$rate = db::getInstance()->exec($acc_status);
if(!$rate){
echo ‘’;
}else{
header(‘Location:…/add_page.php’);
echo ‘’;
}
}[/php]