Hmm. This is much closer to what I want, but I'm still running into a wee problem. The $aid is the unique id, so I don't need to use the $counter exactly like you answered. And the only value I want to pass along is 0 or 1 between the two radio buttons. So now I have something like this:
$query = mysql_query("SELECT * FROM pictures_answers WHERE pid = '$pid' ORDER BY date DESC");
while($result = mysql_fetch_array($query))
{
$counter = $result[aid];
echo "<tr><td>$result[uname]</td><td>$result[answer]</td><td><INPUT type=\"radio\" name=\"radio[$counter]\" value=\"1\"";
if($result[correct] == "1")
echo " checked";
echo "></td><td><INPUT type=\"radio\" name=\"radio[$counter]\" value=\"0\"";
if($result[correct] == "0")
echo " checked";
echo "></td><td>$result[date]</tr>";
The problem is now that when I submit the form, I need to do the foreach and update loop -- and I need the $aid info to do that. Check this out:
foreach($radio as $value)
{
mysql_query("UPDATE pictures_answers SET correct = '$value' WHERE aid = '$aid'");
}
Now, obviously, I need the $aid to update each row, but how do I get that? Is that possible to do that with radio buttons?