Hello:
I'm having troubles with making a dynamic form from a mysql query. I have a simple table with some questions (choice,id). If I had two questions in the table the query produces something like this;
--snip--
<form action="test.php" method="get">
<input name="choice[1]" type="radio" value="1">
<input name="choice[1]" type="radio" value="2">
<input name="id[1]" type="hidden" value="1000"><br />
<input name="choice[2]" type="radio" value="3">
<input name="choice[2]" type="radio" value="4">
<input name="id[2]" type="hidden" value="2000">
<input name="op" type="hidden" value="ds">
<input name="submit" type="submit">
</form>
--snip--
my test.php page looks something like this;
if($op == "ds") {
for($i=1; $i <= count($choice); $i++) {
$choices .= "you picked $choice[$i] of question $id[$i]<br />";
}
echo $choices;
}
now the problem is that if choice[1] is not marked and choice[2] is marked, there is no output for choice[2]. Does anyone know how to solve this problem? I have been working on this for awile and I'm stuck at this point.
KKurcura