Skip site navigation (1) Skip section navigation (2)

Re: Calling Stored Procedures from PHP

From: John DeSoi <desoi(at)pgedit(dot)com>
To: "Cima" <ruel(dot)cima(at)facinf(dot)uho(dot)edu(dot)cu>
Cc: "Pstgres" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Calling Stored Procedures from PHP
Date: 2005-03-29 18:40:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Mar 29, 2005, at 3:48 PM, Cima wrote:

> how do i call a stored procedure i have in postgresql 8.0.1 from  php 
> with the necesary parameters or variables?

You don't say want php interface you are using, but with the standard 
pgsql interface included with php it might look something like this:

$x = 3;
$result = pg_query($conn, "select myprocedure(1, 2, $x);");
$rows = pg_fetch_all($result);

John DeSoi, Ph.D.
Power Tools for PostgreSQL

In response to

pgsql-novice by date

Next:From: Andreas KretschmerDate: 2005-03-29 18:46:36
Subject: Re: [despammed] Calling Stored Procedures from PHP
Previous:From: Gene.BrummDate: 2005-03-29 16:09:25
Subject: Connect to database using pg_connect

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group