Re: Looking for some assistance / guidance --

Поиск
Список
Период
Сортировка
От Jeff Silberberg
Тема Re: Looking for some assistance / guidance --
Дата
Msg-id CALWasQm2i3isreNgi=+fnt2c0CtueeLirCMyCp+A3EEeGOFf0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Looking for some assistance / guidance --  (Michael Wallner <mike@php.net>)
Список pgsql-php
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 <mike@php.net> 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


В списке pgsql-php по дате отправления:

Предыдущее
От: Michael Wallner
Дата:
Сообщение: Re: Looking for some assistance / guidance --
Следующее
От: Michael Wallner
Дата:
Сообщение: New PHP binding: pecl/pq