pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Wallner <mike@php.net>
To: Jeff Silberberg <jms@dapage.net>
To: pgsql-php@postgresql.org
Subject: Re: Looking for some assistance / guidance --
Date: Tue, 29 Jul 2014 11:02:33 +0200
Message-ID: <53D76329.9080309@php.net> (raw)
In-Reply-To: <CALWasQ=LmiZsZdJ1sLUT4jWrULSOLNsGS298yLkafKbEppbEHQ@mail.gmail.com>
References: <CALWasQ=LmiZsZdJ1sLUT4jWrULSOLNsGS298yLkafKbEppbEHQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-php>

On 29/07/14 02:45, Jeff Silberberg wrote:

>       echo "User Keys " . gettype($userKey)."<br>\n";   confirms this is
> a Array ..    An I have tried casting  $1::int[]  in the prepare with no
> luck..
> 

You have to format it as postgresql array string, so that it can be
parsed as array by the server, e.g: '{1,2,3}'::int[]

So, assuming they keys are integers:
$userKey = "{".implode(",",array_map("intval", $userKey))."}::int[]";

-- 
Regards,
Mike


-- 
Sent via pgsql-php mailing list (pgsql-php@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php



view thread (5+ messages)  latest in thread

Message-ID: <53D76329.9080309@php.net>
Permalink:  ../53D76329.9080309@php.net/
Also on:    postgresql.org/message-id/53D76329.9080309@php.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: mike@php.net, jms@dapage.net
  Subject: Re: Looking for some assistance / guidance --
  In-Reply-To: <53D76329.9080309@php.net>
  References: <CALWasQ=LmiZsZdJ1sLUT4jWrULSOLNsGS298yLkafKbEppbEHQ@mail.gmail.com> <53D76329.9080309@php.net>

* 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