hi everyone,
i was trying to save name and all question ids into database.
for question ids,i have multiple dynamic checkboxes.
now what to do,if i want to save all checkbox values into one table.(mysql D😎
this is mysql table format.
mas_id int(11) NOT NULL auto_increment,
name varchar(20) default NULL,
que_id text NOT NULL,
this is what i have done..
if ((isset($POST["MM_insert"])) && ($POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO ts_masterset (que_id, name) VALUES (%s, %s)",
GetSQLValueString($POST['que_id'], "text"),
GetSQLValueString($POST['name'], "text"));
mysql_select_db($database_tsexam, $tsexam);
$Result1 = mysql_query($insertSQL, $tsexam) or die(mysql_error());
<?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' onClick='alert(value);'>";
echo $aquestionsInclude['question'];
echo "<br>";
}
?>
currently with this code i am able to save just last selected checkbox value and not all.
thanks.