InsaneRhino
03-17-2008, 02:41 AM
Im building a questionnaire sort of thing, with the answers to be stored in MySQL. However Im having a problem when I try to insert the data, and the error is vague to say the least. I have spent the last 4 hours trying to fiddle with the code, or do it in different ways. The form is over 1.5k lines long so I wont post the entire thing, only the relevant parts (see below).
The error is:
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 '4, 6, 7, 8, 9, 10, 11, 13, 14, 15a, 15b, 90, 16, 17, 18a, 18b, 18c, 19a, 19b, 19' at line 1
So heres the form code for questions 4-19
<tr>
<td colspan="2" valign="top">
Which best describes the nature of your business?</td>
<td valign="top">
<label><input type="checkbox" name="1a" value="1" /> Grower<br /></label>
<label><input type="checkbox" name="1b" value="1" /> Packer<br /></label>
<label><input type="checkbox" name="1c" value="1" /> Processor<br /></label>
<label><input type="checkbox" name="1d" value="1" /> Importer<br /></label>
<label><input type="checkbox" name="1e" value="1" /> Secondary Supplier<br /></label>
<label><input type="checkbox" name="1f" value="1" /> Other<br /></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
What are your main customer types?</td>
<td valign="top">
<label><input type="checkbox" name="2a" value="1" /> Multiple Retailers<BR /></label>
<label><input type="checkbox" name="2b" value="1" /> Independent Retailers<BR /></label>
<label><input type="checkbox" name="2c" value="1" /> Foodservice<BR /></label>
<label><input type="checkbox" name="2d" value="1" /> Wholesalers<BR /></label>
<label><input type="checkbox" name="2e" value="1" /> Public Sector<BR /></label>
<label><input type="checkbox" name="2f" value="1" /> Other Sectors<br /></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
What is your product range?</td>
<td valign="top">
<label><input type="checkbox" name="3a" value="1" /> Beetroot<br /></label>
<label><input type="checkbox" name="3a" value="1" /> Broccoli<br /></label>
<label><input type="checkbox" name="3c" value="1" /> Brown Onions<br /></label>
<label><input type="checkbox" name="3d" value="1" /> Cabbage<br /></label>
<label><input type="checkbox" name="3e" value="1" /> Carrots<br /></label>
<label><input type="checkbox" name="3f" value="1" /> Cauliflower<br /></label>
<label><input type="checkbox" name="3g" value="1" /> Chili Peppers<br /></label>
<label><input type="checkbox" name="3h" value="1" /> Fruit<br /></label>
<label><input type="checkbox" name="3i" value="1" /> Leeks<br /></label>
<label><input type="checkbox" name="3j" value="1" /> Nuts<br /></label>
<label><input type="checkbox" name="3k" value="1" /> Mild Onions<br /></label>
<label><input type="checkbox" name="3l" value="1" /> Parsnips<br /></label>
<label><input type="checkbox" name="3m" value="1" /> Potatoes<br /></label>
<label><input type="checkbox" name="3n" value="1" /> Red Onions<br /></label>
<label><input type="checkbox" name="3o" value="1" /> Shallots<br /></label>
<label><input type="checkbox" name="3p" value="1" /> Spring Onions<br /></label>
<label><input type="checkbox" name="3q" value="1" /> Swede<br /></label>
<label><input type="checkbox" name="3r" value="1" /> Turnips</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Product and Specifications</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are all products supplied to JSH to be fully traceable?</td>
<td valign="top">
<label><input type="radio" name="4" value="1" /> Back to source (if not your own product)<br /></label>
<label><input type="radio" name="4" value="2" /> Back to field (in all cases)<br /></label>
<label><input type="radio" name="4" value="3" /> Forward to all customers</label></td>
</tr>
<tr>
<td colspan="2" valign="top">
Please describe how this process works</td>
<td valign="top">
<label><textarea name="5" cols="50" rows="5"></textarea></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have a documented product recall procedure?</td>
<td valign="top">
<label><input type="radio" name="6" value="yes" /> Yes<br /></label>
<label><input type="radio" name="6" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Quality System</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
What is the basis of your site controls?</td>
<td valign="top">
<label><input type="radio" name="7" value="a" /> Quality Assurance<br /></label>
<label><input type="radio" name="7" value="b" /> Quality Control<br /></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Does the company have a formal, documented Quality Management System?</td>
<td valign="top">
<label><input type="radio" name="8" value="yes" /> Yes<br /></label>
<label><input type="radio" name="8" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have a documented HACCP system?</td>
<td valign="top">
<label><input type="radio" name="9" value="yes" /> Yes<br /></label>
<label><input type="radio" name="9" value="no" checked="checked"/>No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Have you established effective monitoring & control off all CCP’S?</td>
<td valign="top">
<label><input type="radio" name="10" value="yes" /> Yes<br /></label>
<label><input type="radio" name="10" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Legislation and Insurance</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are you subject to an improvement notice, emergency prohibition order or an emergency control order under the food safety act 1990?</td>
<td valign="top">
<label><input type="radio" name="11" value="yes" /> Yes<br /></label>
<label><input type="radio" name="11" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top">If so, please provide details</td>
<td valign="top">
<textarea name="12" cols="50" rows="5"></textarea></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have Product Liability Insurance cover?</td>
<td valign="top">
<label><input type="radio" name="13" value="yes" /> Yes<br /></label>
<label><input type="radio" name="13" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have a product warranty statement?</td>
<td valign="top">
<label><input type="radio" name="14" value="yes" /> Yes<br /></label>
<label><input type="radio" name="14" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Packhouse Premises</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
When was the packhouse built?</td>
<td valign="top"><select name="15a">
<option>MM</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<select name="15b">
<option>YYYY</option>
<?php
for ($year=date("Y"); $year >= 1800 ;$year--){
?>
<option value="<?php echo $year?>"><?php echo $year?></option>
<?php
}
?>
</select></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Was the packhouse purpose built?</td>
<td valign="top">
<label><input type="radio" name="90" value="yes" /> Yes</label><br />
<label><input type="radio" name="90" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Which best describes where the packhouse is located?</td>
<td valign="top">
<label><input type="radio" name="16" value="a" /> Rural area</label><br />
<label><input type="radio" name="16" value="b" /> Residential area</label><br />
<label><input type="radio" name="16" value="c" /> Industrial area</label><BR>
</td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Is the perimeter secure, clean and tidy?</td>
<td valign="top">
<label><input type="radio" name="17" value="yes" /> Yes<br /></label>
<label><input type="radio" name="17" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are the loading areas:</td>
<td valign="top">
<label><input type="checkbox" name="18a" value="1" /> Restricted access</label><br />
<label><input type="checkbox" name="18b" value="1" /> Level</label><br />
<label><input type="checkbox" name="18c" value="1" /> Covered</label>
</td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are the following in a good state of repair?</td>
<td valign="top"><table width="103" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="45"></td>
<td width="29" align="center">Yes</td>
<td width="29" align="center">No</td>
</tr>
<tr>
<td>Ceiling</td>
<td align="center"><input type="radio" name="19a" value="yes" /></td>
<td align="center"><input type="radio" name="19a" value="no" checked="checked" /></td>
</tr>
<tr>
<td>Walls</td>
<td align="center"><input type="radio" name="19b" value="yes" /></td>
<td align="center"><input type="radio" name="19b" value="no" checked="checked" /></td>
</tr>
<tr>
<td>Floors</td>
<td align="center"><input type="radio" name="19c" value="yes" /></td>
<td align="center"><input type="radio" name="19c" value="no" checked="checked" /></td>
</tr>
</table></td>
</tr>
Heres the INSERT script (the entire thing)
$sql = "INSERT INTO tbl_supplieranswers (userid, 1a, 1b, 1c, 1d, 1e, 1f, 2a, 2b, 2c, 2d, 2e, 2f, 3a, 3b, 3c, 3d, 3e, 3f, 3g, 3h, 3i, 3j, 3k, 3l, 3m, 3n, 3o, 3p, 3q, 3r, 4, 6, 7, 8, 9, 10, 11, 13, 14, 15a, 15b, 90, 16, 17, 18a, 18b, 18c, 19a, 19b, 19c, 20, 21, 22, 23a, 23b, 23c, 23d, 23e, 24, 25, 26, 27, 28, 29, 30, 31, 32a, 32b, 32c, 32d, 33, 34, 35, 36, 37a, 37b3, 37c, 37d, 37e, 37f, 37g, 37h, 37i, 37j, 37k, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89) VALUES ('$id', '$1a', '$1b', '$1c', '$1d', '$1e', '$1f', '$2a', '$2b', '$2c', '$2d', '$2e', '$2f', '$3a', '$3b', '$3c', '$3d', '$3e', '$3f', '$3g', '$3h', '$3i', '$3j', '$3k', '$3l', '$3m', '$3n', '$3o', '$3p', '$3q', '$3r', '$4', '$6', '$7', '$8', '$9', '$10', '$11', '$13', '$14', '$15a', '$15b', '$90', '$16', '$17', '$18a', '$18b', '$18c', '$19a', '$19b', '$19c', '$20', '$21', '$22', '$23a', '$23b', '$23c', '$23d', '$23e', '$24', '$25', '$26', '$27', '$28', '$29', '$30', '$31', '$32a', '$32b', '$32c', '$32d', '$33', '$34', '$35', '$36', '$37a', '$37b', '$37c', '$37d', '$37e', '$37f', '$37g', '$37h', '$37i', '$37j', '$37k', '$38', '$39', '$40', '$41', '$42', '$43', '$44', '$45', '$46', '$47', '$48', '$49', '$50', '$51', '$52', '$53', '$54', '$55', '$56', '$57', '$58', '$59', '$60', '$61', '$62', '$63', '$64', '$65', '$66', '$67', '$68', '$69', '$70', '$71', '$72', '$73', '$74', '$75', '$76', '$77', '$78', '$79', '$80', '$81', '$82', '$83', '$84', '$85', '$86', '$87', '$88', '$89')";
The variables in the SQL are just:
$q1a = $_POST['1a'];
$q1b = $_POST['1b'];
$q1c = $_POST['1c'];
$q1d = $_POST['1d'];
etc
etc
This is because I was trying to remove as many possible causes for the error message. I thought the problem might have been because of the checkboxes in question 1,2 and 3, so I put some Ifs in:
if(!isset($_POST['1a'])) {
$q1a = '0';
}
etc
etc
This didnt help at all. I know its not ideal to shove tonnes of code on here, but I have litterally been trying to figure this problem out for over 4 hours and its nearly 2am so im a bit tired :). If anyone could shine a little light on what is causing the error I would love you forever.
Thanks so much.
PS if a link to the page would help I can provide it, but I dont want to post it publically because the system is very vulnerable at this time.
The error is:
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 '4, 6, 7, 8, 9, 10, 11, 13, 14, 15a, 15b, 90, 16, 17, 18a, 18b, 18c, 19a, 19b, 19' at line 1
So heres the form code for questions 4-19
<tr>
<td colspan="2" valign="top">
Which best describes the nature of your business?</td>
<td valign="top">
<label><input type="checkbox" name="1a" value="1" /> Grower<br /></label>
<label><input type="checkbox" name="1b" value="1" /> Packer<br /></label>
<label><input type="checkbox" name="1c" value="1" /> Processor<br /></label>
<label><input type="checkbox" name="1d" value="1" /> Importer<br /></label>
<label><input type="checkbox" name="1e" value="1" /> Secondary Supplier<br /></label>
<label><input type="checkbox" name="1f" value="1" /> Other<br /></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
What are your main customer types?</td>
<td valign="top">
<label><input type="checkbox" name="2a" value="1" /> Multiple Retailers<BR /></label>
<label><input type="checkbox" name="2b" value="1" /> Independent Retailers<BR /></label>
<label><input type="checkbox" name="2c" value="1" /> Foodservice<BR /></label>
<label><input type="checkbox" name="2d" value="1" /> Wholesalers<BR /></label>
<label><input type="checkbox" name="2e" value="1" /> Public Sector<BR /></label>
<label><input type="checkbox" name="2f" value="1" /> Other Sectors<br /></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
What is your product range?</td>
<td valign="top">
<label><input type="checkbox" name="3a" value="1" /> Beetroot<br /></label>
<label><input type="checkbox" name="3a" value="1" /> Broccoli<br /></label>
<label><input type="checkbox" name="3c" value="1" /> Brown Onions<br /></label>
<label><input type="checkbox" name="3d" value="1" /> Cabbage<br /></label>
<label><input type="checkbox" name="3e" value="1" /> Carrots<br /></label>
<label><input type="checkbox" name="3f" value="1" /> Cauliflower<br /></label>
<label><input type="checkbox" name="3g" value="1" /> Chili Peppers<br /></label>
<label><input type="checkbox" name="3h" value="1" /> Fruit<br /></label>
<label><input type="checkbox" name="3i" value="1" /> Leeks<br /></label>
<label><input type="checkbox" name="3j" value="1" /> Nuts<br /></label>
<label><input type="checkbox" name="3k" value="1" /> Mild Onions<br /></label>
<label><input type="checkbox" name="3l" value="1" /> Parsnips<br /></label>
<label><input type="checkbox" name="3m" value="1" /> Potatoes<br /></label>
<label><input type="checkbox" name="3n" value="1" /> Red Onions<br /></label>
<label><input type="checkbox" name="3o" value="1" /> Shallots<br /></label>
<label><input type="checkbox" name="3p" value="1" /> Spring Onions<br /></label>
<label><input type="checkbox" name="3q" value="1" /> Swede<br /></label>
<label><input type="checkbox" name="3r" value="1" /> Turnips</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Product and Specifications</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are all products supplied to JSH to be fully traceable?</td>
<td valign="top">
<label><input type="radio" name="4" value="1" /> Back to source (if not your own product)<br /></label>
<label><input type="radio" name="4" value="2" /> Back to field (in all cases)<br /></label>
<label><input type="radio" name="4" value="3" /> Forward to all customers</label></td>
</tr>
<tr>
<td colspan="2" valign="top">
Please describe how this process works</td>
<td valign="top">
<label><textarea name="5" cols="50" rows="5"></textarea></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have a documented product recall procedure?</td>
<td valign="top">
<label><input type="radio" name="6" value="yes" /> Yes<br /></label>
<label><input type="radio" name="6" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Quality System</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
What is the basis of your site controls?</td>
<td valign="top">
<label><input type="radio" name="7" value="a" /> Quality Assurance<br /></label>
<label><input type="radio" name="7" value="b" /> Quality Control<br /></label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Does the company have a formal, documented Quality Management System?</td>
<td valign="top">
<label><input type="radio" name="8" value="yes" /> Yes<br /></label>
<label><input type="radio" name="8" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have a documented HACCP system?</td>
<td valign="top">
<label><input type="radio" name="9" value="yes" /> Yes<br /></label>
<label><input type="radio" name="9" value="no" checked="checked"/>No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Have you established effective monitoring & control off all CCP’S?</td>
<td valign="top">
<label><input type="radio" name="10" value="yes" /> Yes<br /></label>
<label><input type="radio" name="10" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Legislation and Insurance</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are you subject to an improvement notice, emergency prohibition order or an emergency control order under the food safety act 1990?</td>
<td valign="top">
<label><input type="radio" name="11" value="yes" /> Yes<br /></label>
<label><input type="radio" name="11" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top">If so, please provide details</td>
<td valign="top">
<textarea name="12" cols="50" rows="5"></textarea></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have Product Liability Insurance cover?</td>
<td valign="top">
<label><input type="radio" name="13" value="yes" /> Yes<br /></label>
<label><input type="radio" name="13" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Do you have a product warranty statement?</td>
<td valign="top">
<label><input type="radio" name="14" value="yes" /> Yes<br /></label>
<label><input type="radio" name="14" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
<font class="header">Packhouse Premises</font></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
When was the packhouse built?</td>
<td valign="top"><select name="15a">
<option>MM</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
<select name="15b">
<option>YYYY</option>
<?php
for ($year=date("Y"); $year >= 1800 ;$year--){
?>
<option value="<?php echo $year?>"><?php echo $year?></option>
<?php
}
?>
</select></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Was the packhouse purpose built?</td>
<td valign="top">
<label><input type="radio" name="90" value="yes" /> Yes</label><br />
<label><input type="radio" name="90" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Which best describes where the packhouse is located?</td>
<td valign="top">
<label><input type="radio" name="16" value="a" /> Rural area</label><br />
<label><input type="radio" name="16" value="b" /> Residential area</label><br />
<label><input type="radio" name="16" value="c" /> Industrial area</label><BR>
</td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Is the perimeter secure, clean and tidy?</td>
<td valign="top">
<label><input type="radio" name="17" value="yes" /> Yes<br /></label>
<label><input type="radio" name="17" value="no" checked="checked"/> No</label></td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are the loading areas:</td>
<td valign="top">
<label><input type="checkbox" name="18a" value="1" /> Restricted access</label><br />
<label><input type="checkbox" name="18b" value="1" /> Level</label><br />
<label><input type="checkbox" name="18c" value="1" /> Covered</label>
</td>
</tr>
<tr>
<td colspan="2" valign="top"><BR></td>
<td valign="top"><BR></td>
</tr>
<tr>
<td colspan="2" valign="top">
Are the following in a good state of repair?</td>
<td valign="top"><table width="103" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="45"></td>
<td width="29" align="center">Yes</td>
<td width="29" align="center">No</td>
</tr>
<tr>
<td>Ceiling</td>
<td align="center"><input type="radio" name="19a" value="yes" /></td>
<td align="center"><input type="radio" name="19a" value="no" checked="checked" /></td>
</tr>
<tr>
<td>Walls</td>
<td align="center"><input type="radio" name="19b" value="yes" /></td>
<td align="center"><input type="radio" name="19b" value="no" checked="checked" /></td>
</tr>
<tr>
<td>Floors</td>
<td align="center"><input type="radio" name="19c" value="yes" /></td>
<td align="center"><input type="radio" name="19c" value="no" checked="checked" /></td>
</tr>
</table></td>
</tr>
Heres the INSERT script (the entire thing)
$sql = "INSERT INTO tbl_supplieranswers (userid, 1a, 1b, 1c, 1d, 1e, 1f, 2a, 2b, 2c, 2d, 2e, 2f, 3a, 3b, 3c, 3d, 3e, 3f, 3g, 3h, 3i, 3j, 3k, 3l, 3m, 3n, 3o, 3p, 3q, 3r, 4, 6, 7, 8, 9, 10, 11, 13, 14, 15a, 15b, 90, 16, 17, 18a, 18b, 18c, 19a, 19b, 19c, 20, 21, 22, 23a, 23b, 23c, 23d, 23e, 24, 25, 26, 27, 28, 29, 30, 31, 32a, 32b, 32c, 32d, 33, 34, 35, 36, 37a, 37b3, 37c, 37d, 37e, 37f, 37g, 37h, 37i, 37j, 37k, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89) VALUES ('$id', '$1a', '$1b', '$1c', '$1d', '$1e', '$1f', '$2a', '$2b', '$2c', '$2d', '$2e', '$2f', '$3a', '$3b', '$3c', '$3d', '$3e', '$3f', '$3g', '$3h', '$3i', '$3j', '$3k', '$3l', '$3m', '$3n', '$3o', '$3p', '$3q', '$3r', '$4', '$6', '$7', '$8', '$9', '$10', '$11', '$13', '$14', '$15a', '$15b', '$90', '$16', '$17', '$18a', '$18b', '$18c', '$19a', '$19b', '$19c', '$20', '$21', '$22', '$23a', '$23b', '$23c', '$23d', '$23e', '$24', '$25', '$26', '$27', '$28', '$29', '$30', '$31', '$32a', '$32b', '$32c', '$32d', '$33', '$34', '$35', '$36', '$37a', '$37b', '$37c', '$37d', '$37e', '$37f', '$37g', '$37h', '$37i', '$37j', '$37k', '$38', '$39', '$40', '$41', '$42', '$43', '$44', '$45', '$46', '$47', '$48', '$49', '$50', '$51', '$52', '$53', '$54', '$55', '$56', '$57', '$58', '$59', '$60', '$61', '$62', '$63', '$64', '$65', '$66', '$67', '$68', '$69', '$70', '$71', '$72', '$73', '$74', '$75', '$76', '$77', '$78', '$79', '$80', '$81', '$82', '$83', '$84', '$85', '$86', '$87', '$88', '$89')";
The variables in the SQL are just:
$q1a = $_POST['1a'];
$q1b = $_POST['1b'];
$q1c = $_POST['1c'];
$q1d = $_POST['1d'];
etc
etc
This is because I was trying to remove as many possible causes for the error message. I thought the problem might have been because of the checkboxes in question 1,2 and 3, so I put some Ifs in:
if(!isset($_POST['1a'])) {
$q1a = '0';
}
etc
etc
This didnt help at all. I know its not ideal to shove tonnes of code on here, but I have litterally been trying to figure this problem out for over 4 hours and its nearly 2am so im a bit tired :). If anyone could shine a little light on what is causing the error I would love you forever.
Thanks so much.
PS if a link to the page would help I can provide it, but I dont want to post it publically because the system is very vulnerable at this time.