pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedDoes php/postgres support placeholder's?
4+ messages / 4 participants
[nested] [flat]
* Does php/postgres support placeholder's?
@ 2005-04-27 20:47 John Mohr <jtmohr@healthconresources.com>
0 siblings, 3 replies; 4+ messages in thread
From: John Mohr @ 2005-04-27 20:47 UTC (permalink / raw)
To: pgsql-php
Does php/postgres support placeholder's in queries and updates. Something
that looks like "select * from x where key=?" ? 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).
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Does php/postgres support placeholder's?
@ 2005-04-28 00:11 John DeSoi <desoi@pgedit.com>
parent: John Mohr <jtmohr@healthconresources.com>
2 siblings, 0 replies; 4+ messages in thread
From: John DeSoi @ 2005-04-28 00:11 UTC (permalink / raw)
To: John Mohr <jtmohr@healthconresources.com>; +Cc: pgsql-php
On Apr 27, 2005, at 4:47 PM, John Mohr wrote:
> Does php/postgres support placeholder's in queries and updates.
> Something that looks like "select * from x where key=?" ? 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).
I see docs for pg_prepare and pg_execute and execute, but it may only
be in the CVS version. I seem to recall a recent mention on the list
that a more complete interface is coming with PHP 5.1.
http://www.php.net/manual/en/ref.pgsql.php
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Does php/postgres support placeholder's?
@ 2005-04-28 01:22 Christopher Kings-Lynne <chriskl@familyhealth.com.au>
parent: John Mohr <jtmohr@healthconresources.com>
2 siblings, 0 replies; 4+ messages in thread
From: Christopher Kings-Lynne @ 2005-04-28 01:22 UTC (permalink / raw)
To: John Mohr <jtmohr@healthconresources.com>; +Cc: pgsql-php
It has special functions for it in 5.1 CVS, but not in release.
However, you can just do it yourself using the PREPARE and EXECUTE
statements:
http://www.postgresql.org/docs/8.0/interactive/sql-prepare.html
http://www.postgresql.org/docs/8.0/interactive/sql-execute.html
Chris
John Mohr wrote:
>
> Does php/postgres support placeholder's in queries and updates.
> Something that looks like "select * from x where key=?" ? 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).
^ permalink raw reply [nested|flat] 4+ messages in thread
* Does php/postgres support placeholder's?
@ 2005-04-28 10:53 Volkan YAZICI <volkan.yazici@gmail.com>
parent: John Mohr <jtmohr@healthconresources.com>
2 siblings, 0 replies; 4+ messages in thread
From: Volkan YAZICI @ 2005-04-28 10:53 UTC (permalink / raw)
To: pgsql-php
Hi,
On 4/27/05, John Mohr <jtmohr@healthconresources.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.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-04-28 10:53 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-27 20:47 Does php/postgres support placeholder's? John Mohr <jtmohr@healthconresources.com>
2005-04-28 00:11 ` John DeSoi <desoi@pgedit.com>
2005-04-28 01:22 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2005-04-28 10:53 ` Volkan YAZICI <volkan.yazici@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox