Re: function with array parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Jean,

>>$result = pg_query($query);

try it as follows

$result=pg_query($database,$query);

where

$database=<database name>

Regards,
Talha Khan

On 11/9/06, Jean-Christophe Roux <jcxxr@xxxxxxxxx> wrote:
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



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux