Advertisement
Guest User

Untitled

a guest
Mar 12th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <html>
  2. <body>
  3. <select>
  4. <?php
  5. $db = pg_connect('host=localhost dbname=test user=myusername password=mypassword') or die ("Could not connect to DB");
  6. $sql = pg_query(sprintf("SELECT City FROM Cities"));
  7. while ($row = pg_fetch_assoc($sql))
  8. {
  9. echo "<option value=$row[City]>$row[City]</option>";
  10. }
  11. pg_close($db);
  12. ?>
  13. </select>
  14. </body>
  15. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement