function with array parameter

From: Jean-Christophe Roux <jcxxr(at)yahoo(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: function with array parameter
Date: 2006-11-08 20:07:23
Message-ID: 20061108200724.43283.qmail@web35311.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hello,
I have a function that I would like to call from a php script:

CREATE OR REPLACE FUNCTION a_dummy(arr_in text[])
RETURNS text AS
$BODY$
declare
begin
return arr_in[1];
end;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

and the php code would be something like that
$arr;
$arr[0] = "one";
$arr[1] = 'two';
$query = "select func_a_dummy($arr)";
$result = pg_query($query);
echo pg_fetch_result($result, 0, 0);

but the syntax is wrong. Any idea what I should do to make it work
Thank you

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Talha Khan 2006-11-08 20:25:29 Re: function with array parameter
Previous Message Robert Treat 2006-11-08 04:32:35 Re: PostgreSQL locking from PHP scripts