Re: [GENERAL] CentOS 7.3, PostgreSQL 9.6.2, PHP 5.4 deliver array as string - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: [GENERAL] CentOS 7.3, PostgreSQL 9.6.2, PHP 5.4 deliver array as string
Date
Msg-id o9a3s2$68q$1@blaine.gmane.org
Whole thread Raw
In response to [GENERAL] CentOS 7.3, PostgreSQL 9.6.2, PHP 5.4 deliver array as string  (Alexander Farber <alexander.farber@gmail.com>)
List pgsql-general
Alexander Farber schrieb am 02.03.2017 um 21:45:
> I am calling this stored function -
>
> CREATE OR REPLACE FUNCTION words_get_board(
>                 in_gid integer
>         ) RETURNS TABLE (
>                 out_bid integer,
>                 out_letters varchar[15][15],
>                 out_values integer[15][15]
>         ) AS
> $func$
>         SELECT
>                 bid,
>                 letters,
>                 values
>         FROM    words_games
>         WHERE   gid = in_gid;
>
> $func$ LANGUAGE sql STABLE;
>
> by a PHP script -
>
>         $sth = $dbh->prepare(SQL_GET_BOARD);
>         $sth->execute(array($gid));
>         if ($row = $sth->fetch(PDO::FETCH_ASSOC)) {
>                 $bid     = $row['bid'];
>                 $letters = $row['letters'];
>                 $values  = $row['values'];
>         }
>
What exactly is the query in SQL_GET_BOARD?
How exactly are you calling that function?




pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: [GENERAL] CentOS 7.3, PostgreSQL 9.6.2, PHP 5.4 deliver array as string
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] CentOS 7.3, PostgreSQL 9.6.2, PHP 5.4 deliver array asstring