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@student.tuwien.ac.at