Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 26th, 2008, 02:05 PM
Erwin Moller
Guest
 
Posts: n/a
Default Postgresql with PHP Procedural Language

Hi,

I was surprised to see that my fav. database offers PHP as a scripting
language Procedural language (eg stored procedures).
Untill now I always used PgPL/SQL for that.

Offered by command prompt:
http://www.commandprompt.com/community/plphp/

Did anybody in here use it?
What are your experiences?
Any advise?

Regards,
Erwin Moller
  #2  
Old March 26th, 2008, 02:05 PM
The Natural Philosopher
Guest
 
Posts: n/a
Default Re: Postgresql with PHP Procedural Language

Erwin Moller wrote:
Quote:
Hi,
>
I was surprised to see that my fav. database offers PHP as a scripting
language Procedural language (eg stored procedures).
Untill now I always used PgPL/SQL for that.
>
Offered by command prompt:
http://www.commandprompt.com/community/plphp/
>
Did anybody in here use it?
What are your experiences?
Any advise?
>
Regards,
Erwin Moller
Ullo Erwin.

Not with Postgres, but its cool with MySql.

What ever rocks yer boat...if it works for you,use it.

PHP has its irritations, but I find it infinitely preferable to other
languages like *shudder* PERL..
  #3  
Old March 26th, 2008, 05:55 PM
Toby A Inkster
Guest
 
Posts: n/a
Default Re: Postgresql with PHP Procedural Language

The Natural Philosopher wrote:
Quote:
Erwin Moller wrote:
>
Quote:
>I was surprised to see that my fav. database offers PHP as a scripting
>language Procedural language (eg stored procedures). Untill now I
>always used PgPL/SQL for that.
>
Not with Postgres, but its cool with MySql.
I think you misunderstand Erwin's post. He's talking about the programming
language used for creating stored procedures within the database. That is,
not accessing database from a script, but the other way around: accessing
a script from the database.

See <http://en.wikipedia.org/wiki/Stored_procedure>.

MySQL only supports stored procedures written in SQL. (And has only
supported stored procedures *at all* since 5.0.)

PostgreSQL allows you to use SQL, C, Tcl, Perl or Python and allows you to
use others through plugins. Plugins are available for Java, Shell script,
and Scheme amongst others.

Erwin posted a link to a plugin allowing the use of PHP as a scripting
language within PostgreSQL. Indeed it looks doubleplusgood. I tend to use
PgPL/SQL (and T-SQL on MS SQL server) but will certainly give this a try.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 3:50.]

Best... News... Story... Ever!
http://tobyinkster.co.uk/blog/2008/03/23/hypnotist/
  #4  
Old March 27th, 2008, 09:45 AM
The Natural Philosopher
Guest
 
Posts: n/a
Default Re: Postgresql with PHP Procedural Language

Toby A Inkster wrote:
Quote:
The Natural Philosopher wrote:
Quote:
>Erwin Moller wrote:
>>
Quote:
>>I was surprised to see that my fav. database offers PHP as a scripting
>>language Procedural language (eg stored procedures). Untill now I
>>always used PgPL/SQL for that.
>Not with Postgres, but its cool with MySql.
>
I think you misunderstand Erwin's post. He's talking about the programming
language used for creating stored procedures within the database. That is,
not accessing database from a script, but the other way around: accessing
a script from the database.
>
See <http://en.wikipedia.org/wiki/Stored_procedure>.
>
MySQL only supports stored procedures written in SQL. (And has only
supported stored procedures *at all* since 5.0.)
>
PostgreSQL allows you to use SQL, C, Tcl, Perl or Python and allows you to
use others through plugins. Plugins are available for Java, Shell script,
and Scheme amongst others.
>
Erwin posted a link to a plugin allowing the use of PHP as a scripting
language within PostgreSQL. Indeed it looks doubleplusgood. I tend to use
PgPL/SQL (and T-SQL on MS SQL server) but will certainly give this a try.
>
Muy Bad.
  #5  
Old March 27th, 2008, 11:15 AM
Erwin Moller
Guest
 
Posts: n/a
Default Re: Postgresql with PHP Procedural Language

Toby A Inkster schreef:
Quote:
The Natural Philosopher wrote:
Quote:
>Erwin Moller wrote:
>>
Quote:
>>I was surprised to see that my fav. database offers PHP as a scripting
>>language Procedural language (eg stored procedures). Untill now I
>>always used PgPL/SQL for that.
>Not with Postgres, but its cool with MySql.
>
I think you misunderstand Erwin's post. He's talking about the programming
language used for creating stored procedures within the database. That is,
not accessing database from a script, but the other way around: accessing
a script from the database.
>
See <http://en.wikipedia.org/wiki/Stored_procedure>.
>
MySQL only supports stored procedures written in SQL. (And has only
supported stored procedures *at all* since 5.0.)
>
PostgreSQL allows you to use SQL, C, Tcl, Perl or Python and allows you to
use others through plugins. Plugins are available for Java, Shell script,
and Scheme amongst others.
>
Erwin posted a link to a plugin allowing the use of PHP as a scripting
language within PostgreSQL. Indeed it looks doubleplusgood. I tend to use
PgPL/SQL (and T-SQL on MS SQL server) but will certainly give this a try.
>
Yes, indeed.
I wasn't talking about accessing Postgresql through PHP, which has been
my hobby for years anyway. ;-)

100% personal perspective:
I have never been very confortable with PgPL/SQL 'scripting language'
inside procedures, and tend to solve as much as possible inside the main
PHP script.
I have had a few nasty bugs, totally created by myself, by using stored
procedures that seemed an easy way out of a nasty problem, at that time...
Using procedures just adds another layer of possible problems, and I
find them harder to spot than pure PHP bugs.
That is why I avoid using SPs, if possible, partly because I don't like
the PgPL/SQL language too much.

But now we can use PHP for that... yummy. :-)

I'll just give it a shot, and see how it works.

Regards,
Erwin Moller
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles