Обсуждение: array as arguments of pg functions and php

Поиск
Список
Период
Сортировка

array as arguments of pg functions and php

От
Ivan Sergio Borgonovo
Дата:
I've read through some solutions proposed on ml, blogs etc... but
maybe something changed or someone came up with a better idea or just
I wasn't able to find a satisfactory solution through google...

Of course PHP arrays can't be passed directly to pg functions so:

I can:
1) write a php function that prepare the array as a string with
proper escaping
2) pass a text string and "number of elements" and let the pg
function parse the text
3) create a temp table and pass it to the function (?)

Can anything be done with prepared statement and pg_execute?
Can pg functions accept variable number of arguments?

I'm going to go with 1) but well it would be nice if I discover
something nicer.

thx

--
Ivan Sergio Borgonovo
http://www.webthatworks.it