Something
public php v1 · immutable echo '<form action="testdl.php" method="post">'; $result = mysql_query("SELECT * FROM vote_alternatives WHERE vote_id='$id'"); for ($x = 0; $x < mysql_num_rows($result); $x++) { $row = mysql_fetch_assoc($result); echo '<input type="radio" name="alternative" value="'.$row['alternative_id'].' onclick="this.form.submit()""> '; echo $row['alternative'].'<br>'; } echo '<input type="submit" name="submit" value="vote">'; echo '</form>';