pg_fetch_array problem - Mailing list pgsql-general

From Alexander Mueller-Koegler
Subject pg_fetch_array problem
Date
Msg-id 3795928C.17047B68@student.tuwien.ac.at
Whole thread Raw
List 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@student.tuwien.ac.at


pgsql-general by date:

Previous
From: "Jonathan davis"
Date:
Subject: how to add users in group
Next
From: "Jonathan davis"
Date:
Subject: pb with pg_group