Does php/postgres support placeholder's?

From: Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: Does php/postgres support placeholder's?
Date: 2005-04-28 10:53:35
Message-ID: 7104a7370504280353ff053cf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi,

On 4/27/05, John Mohr <jtmohr(at)healthconresources(dot)com> wrote:
> Does php/postgres support placeholder's in queries and updates. Something
> that looks like "select * from x where key=?" ?

I think you meant parameters by "placeholders". For example:

INSERT INTO tbl (f1, f2, f3...) VALUES ($1, $2, $3, ...);
SELECT count(oid) FROM tbl WHERE field = $1;

AFAIC, PHP PostgreSQL API doesn't support any X_params() functions.
(Seems like stucked in escapeThatBuggyString() functions.)

> I notice that the call
> interface doesn't support all of the documented calls, for example pg_query
> and pg_send_query, but not pg_query_params (according to pgsql.c, the
> postgres php -> postgres interface program).

Some of the functions I found that don't exist in both latest release
and CVS tree:

pg_prepare()
pg_query_params()
pg_field_type_oid()
pg_send_prepare()
pg_send_query_params()

(CVS checkout for ext/pgsql/pgsql.c:
http://cvs.php.net/co.php/php-src/ext/pgsql/pgsql.c?r=1.244.2.38)

Also, async query functions' interface is new as well. (Committed @
"Sat Mar 19 03:46:55 2005" Related diff:
http://cvs.php.net/php-src/ext/pgsql/pgsql.c?r1=1.315&onb=0)

Regards.

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Volkan YAZICI 2005-05-01 13:59:01 Fwd: Bug #32904: pg_get_notify() ignores result_type param.
Previous Message Christopher Kings-Lynne 2005-04-28 01:22:31 Re: Does php/postgres support placeholder's?