View difference between Paste ID: KkqAYBDN and XA6QztqP
SHOW: | | - or go back to the newest paste.
1
<?php
2
3-
$con = pg_connect("host=localhost dbname=aveiro port =5432 user=pedro password=XylYHpsc");
3+
$con = pg_connect("host=localhost dbname=aveiro port =5432 user=pedro password=****");
4
5
$query = "SELECT DISTINCT rua AS nome FROM ruas";
6
7
$lista = pg_query($con,$query);
8
9
pg_close($con);
10
11
while ($row=pg_fetch_array($lista)) {
12
13
    $nomes=$row["nome"];
14
} 
15
16
?>
17
18
19
<!DOCTYPE html>
20
<html>
21
<body>
22
23
<h1>Testes</h1>
24
25
26
27
<select name="rua">
28
<option value="">Selecione o nome de rua</option>
29
<option value="<?=$nomes?>"><?=$nomes?></option>
30
</select>
31
32
33
34
35
36
</body>
37
</html>