Okay, I'm sure I'm missing something simple, but I'm populating a hidden field on a form with data from a MySQL While statement. the data shows up properly when on the page, but when submitted, the data submitted is always from the last loaded id.
while ($row = mysql_fetch_assoc($result)) {
$id = $row['id'];
echo '<form name="voting" action="thanks_for_voting.php" method="POST">
<align="right"><input type="hidden" name="id" value="'.$id.'"
<br><input type="submit" value="VOTE FOR '.$id.'"><br>';
}
What am I doing wrong? I'm trying to keep a single call to my DB to prevent overloading, I assume there must be a simple way to achieve my goal? But what?
Machineadict solved my problem below by noticing I hadn't been closing my form. I closed it, and the problem was solved. Thanks!