Re: Looking for some assistance / guidance --
Jeff Silberberg <[email protected]> Tue, 29 Jul 2014 09:09:23 -0400
| Newsgroups | gmane.comp.db.postgresql.php |
|---|---|
| Message-ID | <CALWasQm2i3isreNgi=+fnt2c0CtueeLirCMyCp+A3EEeGOFf0w@mail.gmail.com> |
--001a11c2b05099f3dd04ff54bf1c
Content-Type: text/plain; charset=UTF-8
Michael,
About three am I woke up with this same basic thought in my head..
Will try it latter this morning, but I suspect this is the correct
answer.
Thank you !
On Tue, Jul 29, 2014 at 5:02 AM, Michael Wallner <[email protected]> wrote:
> 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
>
--001a11c2b05099f3dd04ff54bf1c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div><div>Michael, <br><br></div>=C2=A0=C2=A0=C2=A0 A=
bout three am I woke up with this same basic thought in my head..=C2=A0 <br=
><br></div>=C2=A0=C2=A0=C2=A0 Will try it latter this morning, but I suspec=
t this is the correct answer. <br>
<br></div>=C2=A0=C2=A0=C2=A0 Thank you !<br><br><div class=3D"gmail_extra">=
<br><br><div class=3D"gmail_quote">On Tue, Jul 29, 2014 at 5:02 AM, Michael=
Wallner <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target=3D"_b=
lank">[email protected]</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"">On 29/07/14 02:45, Jeff Silb=
erberg wrote:<br>
<br>
> =C2=A0 =C2=A0 =C2=A0 echo "User Keys " . gettype($userKey).&=
quot;<br>\n"; =C2=A0 confirms this is<br>
> a Array .. =C2=A0 =C2=A0An I have tried casting =C2=A0$1::int[] =C2=A0=
in the prepare with no<br>
> luck..<br>
><br>
<br>
</div>You have to format it as postgresql array string, so that it can be<b=
r>
parsed as array by the server, e.g: '{1,2,3}'::int[]<br>
<br>
So, assuming they keys are integers:<br>
$userKey =3D "{".implode(",",array_map("intval&quo=
t;, $userKey))."}::int[]";<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Regards,<br>
Mike<br>
</font></span></blockquote></div><br><br>
</div></div>
--001a11c2b05099f3dd04ff54bf1c--