php3-list | 199901
Date: 01/15/99
- Next message: Chad Cunningham: "Re: [PHP3] Beyond Apache module, what to install"
- Previous message: Rasmus Lerdorf: "Re: [PHP3] FW: *PHP3 -> MSSQL"
- In reply to: Emile de Bruijn: "[PHP3] Result in a array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
How about mysql_fetch_array()?
Emile de Bruijn wrote:
> Hello,
>
> Is it possible to put an resultset from a query in an 2 dimisional
> array?
> How do you put the resultset in in and how do I read it again?
>
> I'v tryed everyting, but it never worked. Now I run the query twice like
> in the example below.
>
> (it's for almost two identical dropdowm menu's, if a choice is already
> made before, that choice is checked)
>
> Does someone has a better solution?
>
> echo "<SELECT NAME='kernwoord1' SIZE=1>\n";
> result = mysql_query("SELECT kernwoord FROM KERNWOORDEN ORDER BY
> kernwoord");
> while ($row = mysql_fetch_row($result)) {
> echo "<OPTION VALUE='$row[0]'";
> if (isset($kernwoord1) && $kernwoord1 == $row[0]) echo " SELECTED";
> echo ">$row[0]</OPTION>\n";
> }
> echo "</SELECT>\n\n";
>
> echo "<SELECT NAME='kernwoord2' SIZE=1>\n";
> $result = mysql_query("SELECT kernwoord FROM KERNWOORDEN ORDER BY
> kernwoord");
> echo "<OPTION VALUE='geen'> </OPTION>\n";
> while ($row = mysql_fetch_row($result)) {
> echo "<OPTION VALUE='$row[0]'";
> if (isset($kernwoord2) && $kernwoord2 == $row[0]) echo " SELECTED";
> echo ">$row[0]</OPTION>\n";
> }
> echo "</SELECT>\n\n";
>
> Greetings,
>
> Emile
>
> --
> PHP 3 Mailing List http://www.php.net/
> To unsubscribe send an empty message to php3-unsubscribe <email protected>
> To subscribe to the digest list: php3-digest-subscribe <email protected>
> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3
> List administrator: zeev <email protected>
-- PHP 3 Mailing List http://www.php.net/ To unsubscribe send an empty message to php3-unsubscribe <email protected> To subscribe to the digest list: php3-digest-subscribe <email protected> For help: php3-help <email protected> Archive: http://www.php.net/mailsearch.php3 List administrator: zeev-list-admin <email protected>
- Next message: Chad Cunningham: "Re: [PHP3] Beyond Apache module, what to install"
- Previous message: Rasmus Lerdorf: "Re: [PHP3] FW: *PHP3 -> MSSQL"
- In reply to: Emile de Bruijn: "[PHP3] Result in a array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

