pg_fetch_array problem

From: Alexander Mueller-Koegler <e9426332(at)student(dot)tuwien(dot)ac(dot)at>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_fetch_array problem
Date: 1999-07-21 09:27:40
Message-ID: 3795928C.17047B68@student.tuwien.ac.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello!

I am using RedHat Linux 6.0, Apache 1.3.4, PHP 3.0.11, PostgreSQL 6.5.1
and I have the following problem:
If I use the PHP3-functions pg_fetch_array or pg_fetch_object I get a
popup window saying
"The document contained no data" and my system log says
"Jul 21 10:17:44 smilie logger: pq_recvbuf: unexpected EOF on client
connection"

The PHP-File looks like this:
<?php
$conn = pg_connect("host=localhost dbname=test");
$query = "select * from test where nr=1");
$res = pg_exec($conn, $query);
$data = pg_fetch_array($res, 0);
echo $data["nr"]."\n";
pg_close($conn);
?>

The error message might be produced by
$INSTALL_DIR/src/backend/libpq/pqcomm.c, line 460

If I use pg_fetch_row instead of pg_fetch_array then I get the right
results without any errors.
<?php
$conn = pg_connect("host=localhost dbname=test");
$query = "select * from test where nr=1");
$res = pg_exec($conn, $query);
$data = pg_fetch_row($res, 0);
echo $data[0]."\n";
pg_close($conn);
?>

Does anybody encounter similar problems? Does anybody know how to solve
this problem? Can anybody tell me what I did wrong?
Please reply to my e-Mail-address.

Thanks, Alexander Mueller-Koegler
e9426332(at)student(dot)tuwien(dot)ac(dot)at

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan davis 1999-07-21 09:46:12 pb with pg_group
Previous Message Jonathan davis 1999-07-21 08:57:52 how to add users in group