Home > Archive > PHP with PostgreSQL > April 2005 > Does php/postgres support placeholder's?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Does php/postgres support placeholder's?
John Mohr

2005-04-27, 8:25 pm

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).

John DeSoi

2005-04-27, 8:25 pm


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


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Christopher Kings-Lynne

2005-04-27, 8:25 pm

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/...ql-prepare.html
http://www.postgresql.org/docs/8.0/...ql-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).


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com