Can you provide us with some of the queries you send to database? I'd suggest you test it with some easy and simple one, like this on from PHP documentation:

|$result = pg_query_params($dbconn, 'SELECT * FROM shops WHERE name = $1', 
array("Joe's Widgets"));

Brandon Metcalf napsal(a):
I'm fairly new to PHP but have a great deal of Perl experience for
what it's worth.  I'm having a problem where if I try to use a
parameterized query it fails but pg_last_error() returns nothing.  For

  $result = pg_query_params($pgconn, $update, array($foo, $bar));

  if (! $result) {
      fwrite($fp, "before");
      fwrite($fp, pg_last_error());
      fwrite($fp, "after");

The strings "before" and "after" are showing up in $fp, but nothing
from pg_last_error().  Similarly, if I use pg_prepare() and
pg_execute(), pg_prepare() fails but nothing is returned from

Using pg_query() works, but I need to parameterize the SQL.

The versions I'm using are

  $ php --version
  PHP 5.2.4-2ubuntu5.5 with Suhosin-Patch (cli) (built: Feb 11 2009 
  Copyright (c) 1997-2007 The PHP Group
  Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

and PostgreSQL 8.3.6.

What am I missing?


S pozdravem

Daniel Tlach
Freelance webdeveloper

ICQ: 160914875

Reply via email to