dewey_witt Posted July 11, 2007 Share Posted July 11, 2007 OK i have this form(below) that the value of the checked check boxes inserted into my mysql table in a feild called Arch. Any help will be apriciated <td><input name="Arch[0]" type="checkbox" value="Traditional">Traditional</td> <td><input name="Arch[1]" type="checkbox" value="Victorian">Victorian</td> <td><input name="Arch[2]" type="checkbox" value="Ranch">Ranch</td> </tr> <tr> <td><input name="Arch[3]" type="checkbox" value="Cottage">Cottage</td> <td><input name="Arch[4]" type="checkbox" value="Transistional">Transistinal</td> <td><input name="Arch[5]" type="checkbox" value="Log">Log</td> </tr> <tr> <td><input name="Arch[6]" type="checkbox" value="Cape Cod">Cape Cod</td> <td><input name="Arch[7]" type="checkbox" value="Dutch">Dutch</td> <td><input name="Arch[8]" type="checkbox" value="Contemporary"> Contemporary</td> </tr> <tr> <td><input name="Arch[9]" type="checkbox" value="Salt Box">Salt Box</td> <td><input name="Arch[10]" type="checkbox" value="Historical">Historical</td> <td> <input name="Arch[11]" type="checkbox" value="Chalet">Chalet</td> </tr> <tr> <td><input name="Arch[12]" type="checkbox" value="Colonial">Colonial</td> <td><input name="Arch[13]" type="checkbox" value="Spanish">Spanish</td> <td> <input name="Arch[14]" type="checkbox" value="Tudor">Tudor</td> </tr> Keep in mind i am semi new to php and a colete dumbie. You will have to hold my hand lol Quote Link to comment Share on other sites More sharing options...
trq Posted July 11, 2007 Share Posted July 11, 2007 <?php if (isset($_POST['submit'])) { foreach($_POST['Arch'] as $v) { if (mysql_query("INSERT INTO tbl (Arch) VALUES ('$v');")) { echo "$v added<br />"; } } } ?> Quote Link to comment Share on other sites More sharing options...
dewey_witt Posted July 12, 2007 Author Share Posted July 12, 2007 Thank you This woked like a charm! Quote Link to comment 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.