"Mickey" <news002@susie.dk> wrote in message
news:9gba29$9m7$1@egon.worldonline.dk...
<snip>
> $pred = pg_exec($conn,"SELECT praed FROM program WHERE uge='$uge'");
> $emne = pg_exec($conn,"SELECT emne FROM program WHERE uge='$uge'");
> $teaser = pg_exec($conn,"SELECT teaser FROM program WHERE uge='$uge'");
> $ekstra = pg_exec($conn,"SELECT ekstra FROM program WHERE uge='$uge'");
Hvorfor laver du ikke én select i stedet for 4?
> Der kommer ingen fejl, men en "echo $ekstra" giver "Resource id #6"
Ja, pg_exec giver dig jo ingen data men kun et result index.
> Hvorfor kommer det korrekte resultat ikke frem ?
Du skal hente dataen med f.eks.: pg_fetch_array
Der er gode ting og eksempler i manualen:
<?php
$conn = pg_pconnect ("dbname=publisher");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_Exec ($conn, "SELECT * FROM authors");
if (!$result) {
echo "An error occured.\n";
exit;
}
$arr = pg_fetch_array ($result, 0);
echo $arr[0] . " <- array\n";
$arr = pg_fetch_array ($result, 1);
echo $arr["author"] . " <- array\n";
?>
http://www.php.net/manual/en/ref.pgsql.php
/ morten