I'm trying to populate a pop-up menu with a query. (so i can have a user select a department from the pop-up menu which lists all departments)
what am I doing wrong? any resources that you can point me to? Thanks, Kevin
<?php
$conn = pg_connect("host=postgres user=bla password=bla dbname=bla");
$sql="SELECT department FROM address ;";
$result_set = pg_Exec($conn, $sql);
$rows = pg_NumRows($result_set);
for ($j=0; $j < $rows2; $j++) {
$pos23 = pg_result($result_set, $j, "department");
echo "<select size=1 name=department><option>$pos23</option></select>";
}
}
?>
what am I doing wrong? any resources that you can point me to? Thanks, Kevin
<?php
$conn = pg_connect("host=postgres user=bla password=bla dbname=bla");
$sql="SELECT department FROM address ;";
$result_set = pg_Exec($conn, $sql);
$rows = pg_NumRows($result_set);
for ($j=0; $j < $rows2; $j++) {
$pos23 = pg_result($result_set, $j, "department");
echo "<select size=1 name=department><option>$pos23</option></select>";
}
}
?>