Jump to content

declaring a checkbox in a mysql db viz php from a html form


bhavsta

Recommended Posts

Hi Guys,

 

I have a html form that consists of drop down menus, text boxes and two checkboxs. I can get all the data to be sent to a mysql db via php. But when i try to insert the checkboxes into the db i get an error stating the following:

Could not insert data: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') VALUES ('6','a1','b1','3','c1','1234','1234','[email protected]

 

the code for my html form (checkboxes) is below:

 

<input type="checkbox" border="0" name="dprotection_one" value="1" /> 

 

<input type="checkbox" border="0" name="dprotection_two" value="2" />

 

i have declared the boxes in the php script as follows:

 

$dprotection_one=$_POST['dprotection_one'];

$dprotection_two=$_POST['dprotection_two'];

 

 

Please can someone help me.

 

Regards,

 

Bhav

Archived

This topic is now archived and is closed to further replies.

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