Prepared statements with a variable number of parameters

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: 'PostgreSQL' <pgsql-general(at)postgresql(dot)org>
Subject: Prepared statements with a variable number of parameters
Date: 2009-10-10 17:24:51
Message-ID: 4AD0C363.5050408@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm using PDO in PHP for database access (actually Zend Framework), and
following best practice by using parameters in prepared statements.

My question is, what do people normally do when there's a variable
number of parameters? - for example:

select ..... where item_id in ( ... );

In this case, I mightn't know how many values will go inside the
parentheses.

Thanks,

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2009-10-10 17:52:10 Re: Prepared statements with a variable number of parameters
Previous Message Christophe Pettus 2009-10-10 16:46:43 Building PG 8.4.1 with ossp-uuid on Centos 5.3