Hi,
Your code is exactly what I'm looking for, but I'm still having problems.
The values submitted to the database are just the incrementing numbers between one and ten. (See attachment.)
On the submit.php page, the page containing the form, the following HTML is outputted to the browser
<p><b>Answers: </b>(?)</p>
<p>
<input type="text" name="answer1" maxlength="23" size="30">
<select name="colour1">
<option>Aqua<option>Blue<option>Brown<option>Green<option>Grey<option>Orange<option>Pink<option>Purple<option>Red<option>Yellow </select><br>
<input type="text" name="answer2" maxlength="23" size="30">
<select name="colour2">
<option>Aqua<option>Blue<option>Brown<option>Green<option>Grey<option>Orange<option>Pink<option>Purple<option>Red<option>Yellow </select><br>
<input type="text" name="answer3" maxlength="23" size="30">
<select name="colour3">
<option>Aqua<option>Blue<option>Brown<option>Green<option>Grey<option>Orange<option>Pink<option>Purple<option>Red<option>Yellow </select><br>
<input type="text" name="answer4" maxlength="23" size="30">
<select name="colour4">
<option>Aqua<option>Blue<option>Brown<option>Green<option>Grey<option>Orange<option>Pink<option>Purple<option>Red<option>Yellow </select><br>
<input type="text" name="answer5" maxlength="23" size="30">
<select name="colour5">
<option>Aqua<option>Blue<option>Brown<option>Green<option>Grey<option>Orange<option>Pink<option>Purple<option>Red<option>Yellow </select><br>
</p>
Ignore the bit to do with the colours, because that's going to be a different query.
I've made a few small modifications to your code, which I don't think is making a difference. The code on the create_entry.php page now looks like:
$x=1;
while ($x<=10)
{
$qry="INSERT INTO `poll_answers` (`a_text`) VALUES ('$answer$x')";
$result=mysql_query($qry);
$x++;
}
You can see the screenshot of what is added to the database as the attachment.
dalecosp: where were you mentioning that the double quotes were necessary for?
Can anyone suggest what changes I need to make to anything to get this to sumit the answers from the form as opposed to consecutive numbers?