From: brew@theMode.com
To: pgsql-php@postgresql.org
Subject: Inquiry From Form [pgsql]
Date: Sun, 17 Nov 2002 05:43:16 -0500 (EST)
Message-ID: <Pine.BSF.4.44.0211170524530.37645-100000@themode.com> (raw)
In-Reply-To: <20021115222409.C2DD78A1A87@hub.org>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: brew@theMode.com
Subject: Re: Inquiry From Form [pgsql]
In-Reply-To: <Pine.BSF.4.44.0211170524530.37645-100000@themode.com>
References: <20021115222409.C2DD78A1A87@hub.org> <Pine.BSF.4.44.0211170524530.37645-100000@themode.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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