pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Doug McNaught <doug@mcnaught.org>
To: gearond@cvc.net
Cc: Nigel J. Andrews <nandrews@investsystems.co.uk>
Cc: Greg Stark <gsstark@mit.edu>
Cc: pgsql-general@postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: More PHP DB abstraction layer stuff
Date: 24 Jan 2003 15:01:27 -0500
Message-ID: <m3y95ami5k.fsf@varsoon.wireboard.com> (raw)
References: <2ZNYVFD2X72ONE0091WQPZXGJEC7WR.3e319071@cal-lab>

Dennis Gearon <gearond@cvc.net> writes:

> could you elaborate on:
> 
> 	Place holders ( those are in prepared queries, yes?)
> 	out of band?

I think by "out of band" Greg just means substituting values into a
prepared query rather than glomming everything into an SQL string by
yourself.  For example, in Perl DBI you'd do something like:

$stmt = $dbh->prepare("select * from mytable where first_name = ?");
$ret_val = $sth->execute("Fred");   # might come from a web form instead
@row = $sth->fetchrow_array();

The database driver is responsible for turning the '?' in the query
into a properly-quoted and escaped value, or otherwise supplying it to
the database.  The '?' is a placeholder.

-Doug



view thread (10+ messages)  latest in thread

Message-ID: <m3y95ami5k.fsf@varsoon.wireboard.com>
Permalink:  ../m3y95ami5k.fsf@varsoon.wireboard.com/
Also on:    postgresql.org/message-id/m3y95ami5k.fsf@varsoon.wireboard.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: doug@mcnaught.org, gearond@cvc.net, nandrews@investsystems.co.uk, gsstark@mit.edu, pgsql-general@postgresql.org
  Subject: Re: More PHP DB abstraction layer stuff
  In-Reply-To: <m3y95ami5k.fsf@varsoon.wireboard.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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