O'Reilly logo

PostgreSQL Developer's Handbook by Hans-Jürgen Schönig, Ewald Geschwinde

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required