What I want to do is have a radio button inside a while loop and the name of the radio to be increased by 1 every time the loop is ran.
Right now the code is not working because it is not incrementally increasing. Any suggestions would be great.\[code\]$query = mysql_query("SELECT * FROM table WHERE id = '1' ORDER BY time ASC");echo '<table> <th> A </th> <th> time </th> <th> B </th>'; while($row = mysql_fetch_assoc($query)) { $i= 1; echo '<tr><td>'; echo '<input type="radio" name="';echo $i++; echo'" /> '; echo $row['a']; echo '</td>'; echo '<td>'; echo $row['time']; echo '</td>'; echo '<td>'; echo '<input type="radio" name="';echo $i++; echo '" />'; echo $row['b']; echo '</td> </tr> ';}echo '</tr></table>';\[/code\]
Right now the code is not working because it is not incrementally increasing. Any suggestions would be great.\[code\]$query = mysql_query("SELECT * FROM table WHERE id = '1' ORDER BY time ASC");echo '<table> <th> A </th> <th> time </th> <th> B </th>'; while($row = mysql_fetch_assoc($query)) { $i= 1; echo '<tr><td>'; echo '<input type="radio" name="';echo $i++; echo'" /> '; echo $row['a']; echo '</td>'; echo '<td>'; echo $row['time']; echo '</td>'; echo '<td>'; echo '<input type="radio" name="';echo $i++; echo '" />'; echo $row['b']; echo '</td> </tr> ';}echo '</tr></table>';\[/code\]