Dave,
>
> $result = pg_Exec($conn, "$query");
> if (!$result);
> echo "An error occured inserting information into our
> database.\n";
> exit;
> else;
> pg_close ($conn);
> endif;
> $rows = pg_result($result,0,"row1");
>
(Assuming you're using php3)
I think something like this is what you're looking for:
$conn = pg_Connect("localhost", "5432", "", "", "efakt");
if (!$conn) {
echo "Cannot connect to PostgreSQL database.\n";
exit;
}
$result = pg_Exec($conn, "set datestyle='ISO';
select * from invoices
where seqid = $invid");
if (!$result) {
echo "Faktuur niet gevonden! ($resinv $invid)\n";
exit;
}
$num = pg_NumRows($result);
$i = 0;
while ($i < $num) {
echo pg_Result($result, $i, "invoiceno");
$i++;
}
pg_FreeResult($result);
pg_Close($conn);
Rob den Boer