pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to call a PL/pgSQL function in a PHP script?
4+ messages / 3 participants
[nested] [flat]

* How to call a PL/pgSQL function in a PHP script?
@ 2003-10-02 08:00  Sebastien Baudry <sbaudry@yahoo.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Sebastien Baudry @ 2003-10-02 08:00 UTC (permalink / raw)
  To: pgsql-php

Hi,
I created functions (using PL/pgSQL) in my PostGreSQL database and now I try
to call them in my PHP script but it doesn't succeed.
I can open a connection to the database, run a simple query and get the
result, but I don't know how to do with the functions.
Anybody could help me?

--
Sébastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
@.: sebastien.baudry@baudry-engineering.com
mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
http://www.baudry-engineering.com




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How to call a PL/pgSQL function in a PHP script?
@ 2003-10-02 08:04  Viorel Dragomir <bc@vio.ro>
  parent: Sebastien Baudry <sbaudry@yahoo.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Viorel Dragomir @ 2003-10-02 08:04 UTC (permalink / raw)
  To: sebastien.baudry@baudry-engineering.com; pgsql-php

$query = "SELECT myfunc(param1, param2, param3)";


vio-
----- Original Message ----- 
From: "Sebastien Baudry" <sbaudry@yahoo.com>
To: <pgsql-php@postgresql.org>
Sent: Thursday, October 02, 2003 11:00 AM
Subject: [PHP] How to call a PL/pgSQL function in a PHP script?


> Hi,
> I created functions (using PL/pgSQL) in my PostGreSQL database and now I
try
> to call them in my PHP script but it doesn't succeed.
> I can open a connection to the database, run a simple query and get the
> result, but I don't know how to do with the functions.
> Anybody could help me?
>
> --
> Sébastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
> BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
> @.: sebastien.baudry@baudry-engineering.com
> mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
> http://www.baudry-engineering.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How to call a PL/pgSQL function in a PHP script
@ 2003-10-02 08:46  Ahmad Sentri <sentri@unila.ac.id>
  parent: Sebastien Baudry <sbaudry@yahoo.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Ahmad Sentri @ 2003-10-02 08:46 UTC (permalink / raw)
  To: sebastien.baudry@baudry-engineering.com; +Cc: pgsql-php

in php syntax for call a function 
u can use  in sql select a function that already made 

the way u can write in php syntax with :
$sql_select="SELECT name_of_fanction(var1,var2,...) from name_of_table
===
so if u make a function with the name: name_function
so :
$sql_select="SELECT name_function(var1) from table 
 


On Thu, 2 Oct 2003, Sebastien Baudry wrote:

> Date: Thu, 2 Oct 2003 10:00:10 +0200
> From: Sebastien Baudry <sbaudry@yahoo.com>
> Reply-To: sebastien.baudry@baudry-engineering.com
> To: pgsql-php@postgresql.org
> Subject: [PHP] How to call a PL/pgSQL function in a PHP script?
> 
> Hi,
> I created functions (using PL/pgSQL) in my PostGreSQL database and now I try
> to call them in my PHP script but it doesn't succeed.
> I can open a connection to the database, run a simple query and get the
> result, but I don't know how to do with the functions.
> Anybody could help me?
> 
> --
> Sébastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
> BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
> @.: sebastien.baudry@baudry-engineering.com
> mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
> http://www.baudry-engineering.com
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: How to call a PL/pgSQL function in a PHP script
@ 2003-10-02 08:54  Sebastien Baudry <sbaudry@yahoo.com>
  parent: Ahmad Sentri <sentri@unila.ac.id>
  0 siblings, 0 replies; 4+ messages in thread

From: Sebastien Baudry @ 2003-10-02 08:54 UTC (permalink / raw)
  To: pgsql-php

Sorry, I should have precised that my PL/pgSQL function returns a REFCURSOR
and it's that cursor that I don't know how to manipulate in my PHP script.

-----Message d'origine-----
De : pgsql-php-owner@postgresql.org
[mailto:pgsql-php-owner@postgresql.org]De la part de Ahmad Sentri
Envoyé : Thursday, October 02, 2003 10:46 AM
À : sebastien.baudry@baudry-engineering.com
Cc : pgsql-php@postgresql.org
Objet : Re: [PHP] How to call a PL/pgSQL function in a PHP script


in php syntax for call a function
u can use  in sql select a function that already made

the way u can write in php syntax with :
$sql_select="SELECT name_of_fanction(var1,var2,...) from name_of_table
===
so if u make a function with the name: name_function
so :
$sql_select="SELECT name_function(var1) from table



On Thu, 2 Oct 2003, Sebastien Baudry wrote:

> Date: Thu, 2 Oct 2003 10:00:10 +0200
> From: Sebastien Baudry <sbaudry@yahoo.com>
> Reply-To: sebastien.baudry@baudry-engineering.com
> To: pgsql-php@postgresql.org
> Subject: [PHP] How to call a PL/pgSQL function in a PHP script?
>
> Hi,
> I created functions (using PL/pgSQL) in my PostGreSQL database and now I
try
> to call them in my PHP script but it doesn't succeed.
> I can open a connection to the database, run a simple query and get the
> result, but I don't know how to do with the functions.
> Anybody could help me?
>
> --
> Sébastien BAUDRY - DBA Oracle/MS-SQL & Project Manager
> BAUDRY ENGINEERING BT. H-1025 Budapest Verhalom utca. 31/D. I/8.
> @.: sebastien.baudry@baudry-engineering.com
> mobile.: +36-30-392-0279 / tel: +36-1-326-0241 / fax: +36-1-326-0241
> http://www.baudry-engineering.com
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2003-10-02 08:54 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-02 08:00 How to call a PL/pgSQL function in a PHP script? Sebastien Baudry <sbaudry@yahoo.com>
2003-10-02 08:04 ` Viorel Dragomir <bc@vio.ro>
2003-10-02 08:46 ` Re: How to call a PL/pgSQL function in a PHP script Ahmad Sentri <sentri@unila.ac.id>
2003-10-02 08:54   ` Re: How to call a PL/pgSQL function in a PHP script Sebastien Baudry <sbaudry@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox