Re: Looking for some assistance / guidance --

From: Michael Wallner <mike(at)php(dot)net>
To: Jeff Silberberg <jms(at)dapage(dot)net>, pgsql-php(at)postgresql(dot)org
Subject: Re: Looking for some assistance / guidance --
Date: 2014-07-29 09:02:33
Message-ID: 53D76329.9080309@php.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Jeff Silberberg 2014-07-29 13:09:23 Re: Looking for some assistance / guidance --
Previous Message Jeff Silberberg 2014-07-29 01:26:28 Re: Looking for some assistance / guidance --