Jump to content

Error: storing things from an html form into a mysql table


skidmark10

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.