Hi All,
I need to submit 3 different set of check box values into the database. I have created the 3 sets of checkboxes with 3 different names each set has a particular name e.g. can[],looking[],activities[].
Now I need to use the array values collected from form post.
I need code to help me out on this.
Thanks in advance !!!
Entering multiple checkbox values to database
Moderator: General Moderators
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: Entering multiple checkbox values to database
I might be missing something, but wouldn't this work?
alternatively, depending on how your db is setup, you could implode the array to store the values as a single string?
Code: Select all
$arr = $_POST["looking"];
foreach($arr as $val) {
// code to insert to db here?
}