i have a script that works initially. here is the script:
$conn=pg_connect("host=127.0.0.1 dbname=db user=name password=pword");
if (!$conn){
echo("
Unable to connect to the database server at this time.
");
exit(); }
else{$query0="SELECT municipality FROM municipality where provinceid=$provid
order by municipality;";
$result0=pg_exec($conn, $query0);
}
$numrows0=pg_numrows($result0);
$CurrentRow0=0;
while ($CurrentRow0 < $numrows0) {
$model0=pg_result($result0, $CurrentRow0);
echo "
value=$model0>$model0";
$CurrentRow0++;
}
?>
this is only part of the script. when no municipality is chosen, this still
works. what i mean is that it still shows the municipalities in the drop down
box. but if i choose a certain municipality, there will be no municipalities
shown in the drop down box.
i know there's something wrong with the script but i just can't figure it out.
any ideas?
thanks.
ryanne
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: problem with select option
am 30.01.2003 12:10:56 von adriantineo
This seems to be an HTML issue since you say the records are shown right.
Try to put the tags between . The problem
with html is that it gives you now warnings. How I wish you had to compile
HTML!! Similar issues have had me occupied for hours... besides some
structures will work in a browser but not in the other.
Try on static html until you know it works, then try the script.
Adrian Tineo
> hi list.
>
> i have a script that works initially. here is the script:
>
>
> $conn=pg_connect("host=127.0.0.1 dbname=db user=name password=pword");
> if (!$conn){
> echo("
Unable to connect to the database server at this time.
");
> exit(); }
> else{$query0="SELECT municipality FROM municipality where
provinceid=$provid
> order by municipality;";
> $result0=pg_exec($conn, $query0);
> }
> $numrows0=pg_numrows($result0);
> $CurrentRow0=0;
> while ($CurrentRow0 < $numrows0) {
> $model0=pg_result($result0, $CurrentRow0);
> echo "
> value=$model0>$model0";
> $CurrentRow0++;
> }
> ?>
>
> this is only part of the script. when no municipality is chosen, this
still
> works. what i mean is that it still shows the municipalities in the drop
down
> box. but if i choose a certain municipality, there will be no
municipalities
> shown in the drop down box.
>
> i know there's something wrong with the script but i just can't figure it
out.
> any ideas?
>
> thanks.
>
> ryanne
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster