开发者

How do I fetch a stored postgres function from php

Just a little confused here...

I have a function in postgres, and when 开发者_JAVA技巧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?


Just send the FETCH-query to the database:

$result = pg_query("FETCH ALL FROM zc;");

You can now use a while-loop to fetch all the results in $result or just just pg_fetch_all() to fetch in PHP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜