RE: [PHP] Dynamically generate a drop down list

2003-07-28 Thread Dave [Hawk-Systems]
>> Is it possible to have a function which echoes the values as they are >> read from the database? > >something like > >function init_auth_list() > { > print " select the name of >the author"; > $query="select name from author order by name"; > $result=pg_exec($GLOBALS[

Re: [PHP] Dynamically generate a drop down list

2003-07-28 Thread sven
... or even shorter (since php 4.1.0): function init_auth_list() { print " select the name of the author"; $query="select name from author order by name"; $result=pg_exec($GLOBALS["db"],$query); while ($row = pg_fetch_row($result)) { print "$row[0]"; } print "";

Re: [PHP] Dynamically generate a drop down list

2003-07-28 Thread skate
> Is it possible to have a function which echoes the values as they are > read from the database? something like function init_auth_list() { print " select the name of the author"; $query="select name from author order by name"; $result=pg_exec($GLOBALS["db"],$quer