Add values of multiple selected checkboxes with comma separator

hi all

there are around 30 checkboxes.

i want to insert all selected checkboxes values with a comma separator in
database in one single column.

i m able to echo all the checkboxes selected through the below code


<input  type="checkbox" value="Battery"  name="checkbox[]" id="checkbox[]" /> 


for ($i=0; $i<count($_REQUEST['checkbox']);$i++) {
echo "chosen<br />$i. ".$_REQUEST['checkbox'][$i];
}

output is


0. battery
1. rocket
2. pineapple

i want to insert all selected checkboxes values with a comma separator in
database in one single column.

so what should i write in my query


$query = "insert into checkbox table (checkboxes) values()"

vineet

To get the values into a list:

$List = implode(', ', $_REQUEST['checkbox']);

However, I would recommend a different row for each value, with a column value in common to group them together, e.g. a GroupID.

thanks jake

that worked fine as needed.

if i need to replace comma with number like 1,2,3 then what do i have to do

vineet