RE: Loading values in from postgreSQL database into a combo box using PHP

Поиск
Список
Период
Сортировка
От Wilson Fletcher
Тема RE: Loading values in from postgreSQL database into a combo box using PHP
Дата
Msg-id 01BF9B24.1AC04780.wilson@mclachlan.com.au
обсуждение исходный текст
Список pgsql-sql
I did it this way:
   <?php       $conn = pg_connect("", "", "", "", "webdb");       $result = pg_exec( $conn, "     select fname || ' '
||                              mnames || ' ' || sname                               as name
  from authors" );       $count = 0;       $numrows = pg_numrows( $result );       while ( $count < $numrows ):
 $row = pg_fetch_object ($result, $count);           $list[$count] = "<OPTION>".$row->name;           $count++;
endwhile;      $items = implode( $list, "\n");       pg_close( $conn );       echo "<b>Author :</b> <select
name=author>";      echo "<OPTION SELECTED>".$items."</select><p>\n";   ?>
 


Wilson Fletcher

----------
From:     Jay[SMTP:jmac@nemesis.com.au]
Sent:     Wednesday, 29 March 2000 22:28
To:     pgsql-sql@postgresql.org
Subject:     [SQL] Loading values in from postgreSQL database into a combo box using PHP

I am trying to find the script commands (in a .php3 file) for reading, say,
all the surnames from an Address Book table and load them into a combo (or
drop-down) box so that the user can choose one and then click on submit
button for some other purpose.

Can someone give me an example of how this is done?

JM




В списке pgsql-sql по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: isnull
Следующее
От: Sarfaraz Patel
Дата:
Сообщение: outer join syntax