PostgreSQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

PostgreSQL

Post by madhu »

Hi all,

Can anyone know how to use PostgreSQL functions insteadof Mysql functions as DATABASE.

Please suggest if any installation is needed for use of PostgreSQL Functions.

Waiting for your valuable replies.........

Thanks in advance................
MADHU
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

Post by dibyendrah »

Just replace the mysql and replace with pg. I guess that should work for postgreSQL. The best way to make the application work for multiple database is to use ADODB.
klarinetking
Forum Commoner
Posts: 59
Joined: Mon Jul 24, 2006 9:43 am

Post by klarinetking »

Hi,

Looking in the PHP Manual will provide the answers you need.
php.net wrote:Requirements

To use PostgreSQL support, you need PostgreSQL 6.5 or later, PostgreSQL 8.0 or later to enable all PostgreSQL module features. PostgreSQL supports many character encodings including multibyte character encoding. The current version and more information about PostgreSQL is available at http://www.postgresql.org/ and the PostgreSQL Documentation.
Installation

In order to enable PostgreSQL support, --with-pgsql[=DIR] is required when you compile PHP. DIR is the PostgreSQL base install directory, defaults to /usr/local/pgsql. If shared object module is available, PostgreSQL module may be loaded using extension directive in php.ini or dl() function.
klarinetking
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

As Dibyendrah stated, if you are likely to need to use MySQL and/or postgres at different times it may be worth looking at ADODB. It is important to also note that the table structures (notably automatic sequencing) differ. You cannot simply get last inserted id in postgres. You need to get the sequence, then insert it if you need it again.
Post Reply