Re: PHP array to PlPgSQL arrat. How to? - Mailing list pgsql-general

From Pavel Stehule
Subject Re: PHP array to PlPgSQL arrat. How to?
Date
Msg-id AANLkTi=x=XQVNeTW1TCUACLVUvLN7RT0PqzGFTU5sYqW@mail.gmail.com
Whole thread Raw
In response to PHP array to PlPgSQL arrat. How to?  (Andre Lopes <lopes80andre@gmail.com>)
Responses Re: PHP array to PlPgSQL arrat. How to?  (Andre Lopes <lopes80andre@gmail.com>)
List pgsql-general
Hello

there isn't a simple way :(

the most simply way is using string_to_array function

SELECT func(string_to_array('1,2,3,4,5',','));

Regards

Pavel Stehule


2011/3/5 Andre Lopes <lopes80andre@gmail.com>:
> Hi,
>
> I need to transform an PHP array to an PlPgSQL array. The PHP array is
> like this:
>
> [quote]
> $arr = array(
>                                0 => array(
>                                                        "base64" => "ddfffffff",
>                                                        "image_type" => "jpg",
>                                                        "width" => "343",
>                                                        "height" => "515",
>                                                        "html_width_height" => 'width="343" height="515"',
>                                                        "mime" => "image/jpeg"
>                                                        ),
>                                1 => array(
>                                                        "base64" => "ddfffffffddddd",
>                                                        "image_type" => "jpg",
>                                                        "width" => "343",
>                                                        "height" => "515",
>                                                        "html_width_height" => 'width="343" height="515"',
>                                                        "mime" => "image/jpeg"
>                                                        )
>                        );
> [/quote]
>
> How can I pass this kinf of PHP array to PlPgSQL?
>
> Give me a clue.
>
> Best Regards,
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Andre Lopes
Date:
Subject: PHP array to PlPgSQL arrat. How to?
Next
From: Andre Lopes
Date:
Subject: Re: PHP array to PlPgSQL arrat. How to?