Generating readio buttons

From: Date: Sun, 03 Nov 2002 18:47:37 +0000
Subject: Generating readio buttons
Groups: php.db 
Request: Send a blank email to php-db+get-22929@lists.php.net to get a copy of this message
Howdy -- How do I dynamically generate the "value" for radio buttons off the DB (MySQL) backend? Here's some code that almost works TIA, David --------------------- Almost works ---------------------------- <?php $header = mysql_query ("SELECT * FROM chart
           ORDER BY acct ");
if ($row = mysql_fetch_array($header)) {
        do {
        print("<tr  bgcolor=\"white\" >");
   print '<td width="5"><input type="radio" name="gl_acct" value=acct[]"></td>';
print("<td width=\"12\">"); print $row["acct"];
        print "</td><td width=\"12\">";
print $row["cat"];
        print "</td><td >";
print $row["descript"]; print("</td></tr>\n");
               } while($row = mysql_fetch_array($header));
            } else {print "Sorry, no records were found!";}
?>

« previous php.db (#22929) next »