skidmark10 Posted July 30, 2011 Share Posted July 30, 2011 I am trying to insert answers from a checkbox on an html form into a mysql table using php. For some odd reason, the data doesnt make it to the mysql table. I'm not sure what the issue is, so I posted all of the information I have so I can see where I made my mistake. thanks in advance. Here is the html <table class=MsoNormalTable border=0 cellpadding=0 width="100%" style='width:100.0%;mso-cellspacing:1.5pt;mso-yfti-tbllook:1184;mso-padding-alt: 0in 5.4pt 0in 5.4pt'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> <td width="100%" style='width:100.0%;padding:.75pt .75pt .75pt .75pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"'><INPUT TYPE="checkbox" NAME="partnerbodytype1" VALUE="Slender|Slim"> Slender/Slim <o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:1'> <td width="100%" style='width:100.0%;padding:.75pt .75pt .75pt .75pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"'><INPUT TYPE="checkbox" NAME="partnerbodytype2" VALUE="Average"> Average <o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:2'> <td width="100%" style='width:100.0%;padding:.75pt .75pt .75pt .75pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"'><INPUT TYPE="checkbox" NAME="partnerbodytype3" VALUE="Athletic"> Athletic <o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:3;mso-yfti-lastrow:yes'> <td width="100%" style='width:100.0%;padding:.75pt .75pt .75pt .75pt'> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"'><INPUT TYPE="checkbox" NAME="partnerbodytype4" VALUE="Heavy"> Heavy <o:p></o:p></span></p> </td> </tr> </table> </div> Here is the php code $sqlpartnersbodytype= "INSERT INTO `Partners_Body_Types` (Slim_Slender, Average, Athletic, Heavy) VALUES ('$_POST[partnerbodytype1]','$_POST[partnerbodytype2]', '$_POST[partnerbodytype3]','$_POST[partnerbodytype4]')"; Here is the table information `Partners_Body_Types` CHANGE `Slim_Slender` `Slim_Slender` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , CHANGE `Average` `Average` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , CHANGE `Athletic` `Athletic` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL , CHANGE `Heavy` `Heavy` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL Quote Link to comment Share on other sites More sharing options...
stijnvb Posted July 30, 2011 Share Posted July 30, 2011 Is this all the code you are using? It seems you might want to use mysql_query($sqlpartnersbodytype); in order for it to do anything at all :-) Quote Link to comment Share on other sites More sharing options...
skidmark10 Posted July 30, 2011 Author Share Posted July 30, 2011 Thank YOU 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.