Chapter 18. Persistent Database Connections with PHP

Persistent database connections are a core feature of PHP, and they can be used to speed up your applications significantly.

Before we get to some performance tests and an example, let's look at what persistent database connections are and how they can be used.

The difference between a persistent and a non-persistent database connection is, that persistent connections are not closed at the end of a script. If you want to establish a persistent connection to your database, PHP checks whether an identical connection exists. Identical means that the name of the host, the username, and the password have to be the same. If no suitable connection is available, a new connection is established.

The advantage ...

Get PostgreSQL Developer's Handbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.