Re: PL/pgSQL and PHP 5

From: John DeSoi <desoi(at)pgedit(dot)com>
To: PostgreSQL Admin <postgres(at)productivitymedia(dot)com>
Cc: Lista PG-PHP <pgsql-php(at)postgresql(dot)org>, PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: PL/pgSQL and PHP 5
Date: 2006-08-10 06:12:08
Message-ID: E09B3902-103E-41D7-A03F-BA8D45BFEFC8@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php pgsql-sql

Glad you found the problem.

On Aug 9, 2006, at 11:42 PM, PostgreSQL Admin wrote:

> $connection->execute("SELECT insert_staff_b('$staff
> [insert_firstname]'::varchar)");
> $connection->execute("SELECT insert_staff_b('".$staff
> ['insert_firstname']."'::varchar)");

If you are creating SQL functions you want to call from PHP, you
might be interested in this simple class:

http://pgedit.com/resource/php/pgfuncall

Then instead of all the quoting issue you have above, you could
simply call your SQL function like a normal PHP method call:

$connection->insert_staff_b($staff['insert_firstname']);

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Fatih Gulec 2006-08-13 15:27:28 DB Error: connect failed
Previous Message PostgreSQL Admin 2006-08-10 04:01:32 Re: [SQL] PL/pgSQL and PHP 5 - thanks

Browse pgsql-sql by date

  From Date Subject
Next Message Chad Voelker 2006-08-10 11:52:33 Re: Function Temp Table Woes
Previous Message PostgreSQL Admin 2006-08-10 04:01:32 Re: [SQL] PL/pgSQL and PHP 5 - thanks