PHP and PostgreSQL
There's something patently unfair going on here. For some reason, almost every PHP tutorial on the planet
makes the implicit assumption that if you're using PHP with a database, that database is going to be MySQL ...
your PHP build must support PostgreSQL in order for the examples in this article to work correctly.
You can include PostgreSQL support in your PHP build by adding the "â â withâ pgsql" configuration
parameter when compiling the package. Note also that PHP 4.2.0 and better contains fairly extensive changes
to the function names used in the language's PostgreSQL module; this article uses the new function names and
assumes that you're running PHP 4.2.x. Drop by http://www.php.net/manual/en/ref.pgsql.php for more
information on the changes, and the corresponding function names for older versions.
I'm not going to get into the details of configuring and installing either PostgreSQL or PHP here â the
documentation included with both those packages has more than enough information to get you started, and
the accompanying Web sites contain lots of troubleshooting information should you encounter problems. In
case you don't already have these packages installed on your development system, drop by the Web sites
listed above, get yourself set up and come back once you're done.
the PostgreSQL server must be started as the special "postgres" user created during the installation
process, and the startup invocation must include the additional "â i" parameter to allow TCP/IP connections to
the server.
using PHP to get data from a PostgreSQL database involves several steps, each of which is
actually a preâ defined PHP function.
...
Source: debian.yaako.org

Topic: