# How to save all dynamic checkboxes value in one row od DB?

**URL:** <https://forum.kirupa.com/t/how-to-save-all-dynamic-checkboxes-value-in-one-row-od-db/223485>\
**Category:** Uncategorized\
**Created:** [April 23, 2007, 8:44am UTC](https://forum.kirupa.com/t/how-to-save-all-dynamic-checkboxes-value-in-one-row-od-db/223485 "2007-04-23T08:44:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phpkets](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@phpkets](https://forum.kirupa.com/u/phpkets)\
**Post date:** [April 23, 2007, 8:44am UTC](https://forum.kirupa.com/t/how-to-save-all-dynamic-checkboxes-value-in-one-row-od-db/223485/1 "2007-04-23T08:44:02Z")

</div>

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.
