title: Converting a PHP/HTML drop-down menu to radio buttons
body: <p>Currently I have a loop of drop-down menus (loop is dependent on the results per page that I can define, you can see why I would use a loop), and I would like to turn the drop-down menus to radio buttons. Below is my code. Could you give me some pointers on how I could convert it?</p>
  
  <pre><code>if (isset($_POST['formSubmit'])){
      $rating = $_POST['rating'];
      $accountID = $_POST['accountID']; 
  
      $query = mysql_query("UPDATE Spreadsheet SET rating='$rating' WHERE accountID='$accountID'");
  }
  
  while ($row = mysql_fetch_array($query)){
  
      ?&gt;
  
  &lt;form name ="rating" method ="POST" action ="" &gt; &lt;?
  
  echo "&lt;input type = 'hidden' name = 'accountID' value = '" . $row['accountID'] . "' &gt;";
  
  ?&gt;
      &lt;select name="rating"&gt;
  
          &lt;? 
  
          $values = array('0 - No rating','1 - Very Bad','2 - Bad','3 - Average','4 - Above Average');
  
          for ($i =0; $i &lt; count($values); $i++){
              echo "&lt;option value = \"$i\""; 
  
              if ($row['rating'] == $i) {
                  echo "selected=\"selected\"";
              }
  
              echo "&gt;" . $values[$i] . "&lt;/option&gt;";
  
          }
  
          ?&gt;
  
          &lt;/select&gt;
          &lt;input type ="Submit" name ="formSubmit" value ="Submit" /&gt;
          &lt;/form&gt;
  </code></pre>