I originally posted the question here: http://stackoverflow.com/questions/2536727/calling-a-stored-postgres-function-from-php
I accepted the answer, but, it actually isn't working for me... Here's the original question:
I have a function in postgres, and when I'm at the pg prompt, I just do:
SELECT zp('zc',10,20,90);
FETCH ALL FROM zc;
I'm wondering how to do this from php?
I thought I could just do:
$q = pg_query("SELECT zp('zc',10,20,90)");
But, how do I "fetch" from that query?
I'm still not entirely certain how to do this...
I tried
$q = pg_query("SELECT zp('zc',10,20,90)");
$f = pg_query("FETCH ALL FROM zc");
while($row = pg_fetch_array($f)) ...
and
while($row = pg_fetch_all($f)) ...
and
$q = pg_query("SELECT zp('zc',10,20,90);FETCH ALL FROM zc;")
while($frow = pg_fetch_array($q)) ...