How can I include mysql-query results as <options> in a html-skript?
| From: | Joachim Ritzer | Date: | Mon, 09 Oct 2000 14:07:16 +0000 |
| Subject: | How can I include mysql-query results as <options> in a html-skript? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19189@lists.php.net to get a copy of this message | ||
hi everybody,
Since a few days I try to include the result of a MySQL-query as options
into html-skript. I know this sentence is not very precise, but if you may
take a look on the following lines (see <OPTION>) you will know what I´m
talking about.
<?
$query = ("SELECT matrikelnummer FROM diplomanden ORDER BY matrikelnummer");
$result = mysql_query($query, $db);
$number = mysql_num_rows($result);
$matrikelnummer = mysql_fetch_array($result,MYSQL_NUM);
?>
...
<TR>
<TD bgColor=#ffe4b5>Matrikelnummer:</TD>
<TD><SELECT id="" name=matrikelnummer
style="HEIGHT: 22px; WIDTH: 150px">
<OPTION > (here should be the first element of the array
$matrikelnummer)
<OPTION >(here the 2nd)
<OPTION> (3rd .....)
</SELECT>
Thanks to everybody and maybe next time I will be able to help.
Regards Joachim.