Over a million developers have joined DZone.

Using MySQL with PHP MySQLi: Connections, Options, Pooling

DZone's Guide to

Using MySQL with PHP MySQLi: Connections, Options, Pooling

· Web Dev Zone ·
Free Resource

Learn how error monitoring with Sentry closes the gap between the product team and your customers. With Sentry, you can focus on what you do best: building and scaling software that makes your users’ lives better.

The next post in Ulf Wendel's tutorial series on MySQLi recently surfaced.  This post deals with parameter defauls in MySQLi database connections, built-in connection library defaults, and connection pooling.  There's also a sizable section devoted to persistent connection and the issues they can cause:

A common complain about persistent connections is that their state is not reset before reuse. For example, open, unfinished transactions are not automatically rolled back. But also, authorization changes which happened in the time between putting the connection into the pool and reusing it are not reflected. This may be seen as an unwanted side-effect. On the contrary, the name persistent may be understood as a promise that the state is persisted.

Check out the full post for all the MySQLi goodness.  If you want to catch up, make sure you check out part 1 on stored procedures, part 2 on prepared statements and part 3 on multiple statements in one statement string. 

What’s the best way to boost the efficiency of your product team and ship with confidence? Check out this ebook to learn how Sentry's real-time error monitoring helps developers stay in their workflow to fix bugs before the user even knows there’s a problem.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}