vinpkl Posted April 9, 2010 Share Posted April 9, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/198135-adding-multiple-checkboxes-values-to-database/ Share on other sites More sharing options...
fenway Posted April 9, 2010 Share Posted April 9, 2010 Not sure what you're trying to do... multi-valued insert statement? Quote Link to comment https://forums.phpfreaks.com/topic/198135-adding-multiple-checkboxes-values-to-database/#findComment-1039596 Share on other sites More sharing options...
vinpkl Posted April 9, 2010 Author Share Posted April 9, 2010 hi fenway, i am just try to insert the values of multiple checkboxes in my mysql database. vineet Quote Link to comment https://forums.phpfreaks.com/topic/198135-adding-multiple-checkboxes-values-to-database/#findComment-1039597 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.