RE: [GENERAL] pg_result
От | Rob den Boer |
---|---|
Тема | RE: [GENERAL] pg_result |
Дата | |
Msg-id | 000901bda0d4$4287aa20$67032e9f@hrs_nt.hrs обсуждение исходный текст |
Ответ на | pg_result (davez@istand.com) |
Список | pgsql-general |
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
В списке pgsql-general по дате отправления: