June 2002
Intermediate to advanced
800 pages
16h 3m
English
The first thing you have to do when working with PHP and PostgreSQL is to connect to the database. Just as when you're working with a file, you need a handle to identify a connection and to interact with it. To generate this handle, you must use pg_connect. pg_connect establishesa connection to the database and returns a database handle. The connect string sent to the database is the same string you'd use in a C program. This is an important point because PHP's PostgreSQL interface is built on C, so the behavior of PHP is easy to understand if you are familiar with the C interface. However, to work with this book, you don't have to be familiar with C.
Let's see how to establish a connection to the database:
Read now
Unlock full access