hi everyone,
i have no. of dynamic checboxes in my form.
now not able to figure out in this code that how can i save all checkbox values in one table.
DB table’s format is :
mas_id int(11) NOT NULL auto_increment,
name varchar(20) NOT NULL default ‘’,
que_id text NOT NULL,
php code looks like :
if ((isset($_POST[“MM_insert”])) && ($_POST[“MM_insert”] == “form1”)) {
$que_id = ‘’;
foreach($_POST[“que_id”] AS $key => $value){
$insertSQL = sprintf(“INSERT INTO ts_masterset (que_id, name) VALUES (%s, %s)”,
GetSQLValueString($_POST[‘que_id’], “text”),
GetSQLValueString($_POST[‘name’], “text”));}
and my html code looks like, where i am generating all questions :
<?php $questionsInclude = mysql_query(“SELECT * FROM ts_questions WHERE setid=’”.$row_tsset[‘id’]."’");
while($aquestionsInclude = mysql_fetch_array($questionsInclude)){
$qd = $aquestionsInclude[‘id’];
echo “<input name=‘que_id[]’ type=‘checkbox’ value=’$qd’>”;
echo $aquestionsInclude[‘question’];
echo “<br>”; }?>
but with this code i am getting “Array” as a value in database.
any idea, where i am doing wrong !
thanks.