Over a million developers have joined DZone.

Using MySQL with PHP MySQLi: Connections, Options, Pooling

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

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. 

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}