Jump to content

adding multiple checkboxes values to database


vinpkl

Recommended Posts

hi all

 

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];
}

 

ouput is

0. battery
1. rocket
2. pineapple

 

but i want to insert all selected checkboxes values in database.

 

so what should i write in my query

 

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

 

vineet

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.