Inquiry From Form [pgsql] - Mailing list pgsql-php

From brew@theMode.com
Subject Inquiry From Form [pgsql]
Date
Msg-id Pine.BSF.4.44.0211170524530.37645-100000@themode.com
Whole thread Raw
In response to Inquiry From Form [pgsql]  (William <DarkCancerian@netscape.net>)
Responses Re: Inquiry From Form [pgsql]
Re: Inquiry From Form [pgsql]
List pgsql-php
On Fri, 15 Nov 2002, William wrote:

> I code with PHP and use it to communicate with MySQL, if I started using
> PostgreSQL would I have to change my coding to communicate with the
> database?

Probably, but only slightly.

I changed my DB from MySQL to PostgreSQL and had to change each SQL call
slightly.  It seems to me the difference was PostgreSQL needs to know the
number of rows gotten and then loop through them with a for loop, with
MySQL I was able to use a while loop without checking the number of rows
first.

It could have been my inexperience that caused me to miss the obvious,
though.

In perl there is the DBI module and php has DBX.  With it you use a common
calling cenvention across a bunch of Databases (FrontBase, Microsoft SQL
Server, MySQL, ODBC, PostgreSQL, Sybase-CT, Oracle)


From the manual at php.net:

 -----------------------------------------------

The dbx functions allow you to access all supported databases using a
single calling convention. The dbx-functions themselves do not interface
directly to the databases, but interface to the modules that are used to
support these databases.

 -----------------------------------------------

Of course, not all these DBs offer the same features, so you'd still not
be database independent unless you limit your DB calls to the common ones,
most likely SELECT, INSERT, UPDATE, and DELETE.  But if you are using
MySQL maybe that's all you are doing anyway.......

I don't have the dbx module available on my machine and since I'm
committed to using (and learning more about) PostgreSQL I don't use the
dbx.  But it seems it would be a good way to go......


Maybe someone else will chime in with more info.

brew



pgsql-php by date:

Previous
From: William
Date:
Subject: Inquiry From Form [pgsql]
Next
From: Budi Rianto
Date:
Subject: Re: Inquiry From Form [pgsql]