thank you for your reply houdini,
sorry i didnt make my question clearer. basically, i have a few candidates in a ballot. so each candidate will have his own group of radio buttons. the name of each candidate's group will be set as his/her name but the values will be different as you can see below and in the html source i've also included.
<input type="radio" name="Wayne Rooney" value="1"/>
<input type="radio" name="Wayne Rooney" value="2"/>
<input type="radio" name="Wayne Rooney" value="3"/>
<input type="radio" name="Wayne Rooney" value="4"/>
the voter will select a number(for this example, 1 to 4). so what im having trouble with is what to write in the $_POST, so that the script checks which candidate's radio button has been selected.
i can't manually set the name of each candidate because each ballot will have different candidates, so the names would be different and thats the reason i have set the name of each candidate in the for loop as:
name="'.$arr1['name'].'"
$arr1 is defined as:
$arr1=mysql_fetch_array($result, MYSQL_ASSOC);
so the name of each radio button will be the name of each candidate because $result is set thus:
$query="SELECT CONCAT(candidate_Fname, ' ', candidate_Sname) AS name FROM candidates";
$result=@mysql_query($query);
also $num is:
$num=mysql_num_rows($result);
below is the html source for the page:
<form action="registervote.php" method="post"><table align="center" cellspacing="50" cellpadding="5" border="2"><tr><th align="center" bgcolor="yellow">Wayne Rooney</th><td align="center">1<input type="radio" name="Wayne Rooney" value="1"/></td><td align="center">2<input type="radio" name="Wayne Rooney" value="2"/></td><td align="center">3<input type="radio" name="Wayne Rooney" value="3"/></td><td align="center">4<input type="radio" name="Wayne Rooney" value="4"/></td></tr><th align="center" bgcolor="yellow">John Smith</th><td align="center">1<input type="radio" name="John Smith" value="1"/></td><td align="center">2<input type="radio" name="John Smith" value="2"/></td><td align="center">3<input type="radio" name="John Smith" value="3"/></td><td align="center">4<input type="radio" name="John Smith" value="4"/></td></tr><th align="center" bgcolor="yellow">Eric Cantona</th><td align="center">1<input type="radio" name="Eric Cantona" value="1"/></td><td align="center">2<input type="radio" name="Eric Cantona" value="2"/></td><td align="center">3<input type="radio" name="Eric Cantona" value="3"/></td><td align="center">4<input type="radio" name="Eric Cantona" value="4"/></td></tr><th align="center" bgcolor="yellow">Cristiano Ronaldo</th><td align="center">1<input type="radio" name="Cristiano Ronaldo" value="1"/></td><td align="center">2<input type="radio" name="Cristiano Ronaldo" value="2"/></td><td align="center">3<input type="radio" name="Cristiano Ronaldo" value="3"/></td><td align="center">4<input type="radio" name="Cristiano Ronaldo" value="4"/></td></tr></table><p><br /><center/><input type="submit" name="submit" value="VOTE!" /></p><input type="hidden" name="submitted" value="TRUE" />
i hope that i've made it clearer now and apologies for how long this is. i look forward to your reply.thnx again.