Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = pg_connect("host=localhost dbname=aveiro port =5432 user=pedro password=****");
- $query = "SELECT DISTINCT rua AS nome,n_rua AS id FROM ruas";
- $result = pg_query($con,$query);
- pg_close($con);
- ?>
- <!DOCTYPE html>
- <html>
- <body>
- <h1>Testes</h1>
- <select name="rua">
- <?php
- while ($line = pg_fetch_array($result)) {
- echo '<option value="' . $line['id'] . '">' . $line['nome'] . '</option>';
- }
- ?>
- </select>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement