bhavsta Posted March 23, 2007 Share Posted March 23, 2007 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 Link to comment https://forums.phpfreaks.com/topic/43989-declaring-a-checkbox-in-a-mysql-db-viz-php-from-a-html-form/ Share on other sites More sharing options...
monk.e.boy Posted March 23, 2007 Share Posted March 23, 2007 Try echoing the value of the SQL command. I expect you have quotes in the drop down values you are passing into it. Or they are NULL. Rule 1 - echo SQL. Well, that's the only rule really. monk.e.boy Link to comment https://forums.phpfreaks.com/topic/43989-declaring-a-checkbox-in-a-mysql-db-viz-php-from-a-html-form/#findComment-213637 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.