Re: Calling a Stored Procedure using PHP

From: "Jason Priebe" <priebe(at)mi-corporation(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Calling a Stored Procedure using PHP
Date: 2002-01-15 12:37:40
Message-ID: DDEFLFOEOANDFODMJHEJAEOKCJAA.priebe@mi-corporation.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Original Message-----
> Subject: [GENERAL] Calling a Stored Procedure using PHP
>
>
> I've written a simple stored procedure in postgres and I'm trying
> to get PHP
> to call the function and show the results. My problem is I can't
> get PHP to
> bring up my results. I'm using the PHP functions for postgres, such as
> pg_exec and pg_fetch_array, but nothing is working. What do I need to do?
> What am I missing? Can someone help me?
>
> Any help would be very much appreciated.
>
> Wendy

Are you doing it like this?

$dbh = pg_connect ($connect_string);
$result = pg_exec ($dbh, "SELECT yourstoredprocedure()");

You can't call it directly; you call it as part of a SELECT query.
Then pull the results like you would for any SELECT query.
Hope this helps.

Jason Priebe
Mi-Co
http://www.mi-corporation.com/

Attachment Content-Type Size
Jason Priebe.vcf text/x-vcard 528 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Welche 2002-01-15 13:54:55 Re: Adding constraint to existing table.
Previous Message Justin Clift 2002-01-15 12:05:04 Re: Very large database - Now OT