So pleased to see PDO as example coding rather than the deprecated MySQL that seems to still be persisting even some five or six years after the official decree of non-support for MySQL. The only thing I could say contrary to this is that you might want to even start shifting away from MySQLi even. I DO understand there are certain technical advantages to it, but, having done trial-by-fire of converting a complete MySQL web application into a PDO-driven one, I can tell you that I really didn't have any opportunity where I thought MySQLi would've been a better fit. Although, to each their own, and thanks for the proof-of-concept code.
Ashraf Gheith - 2015-08-30 19:39:04 - In reply to message 3 from Lee Davis
A good point, I wanted once to do that, but never found a time :). Anyway this article is a general tutorial and not specific about DB connections. I will think about writing an article about PDO ;).
We will see what PHP7 will bring to us anyway.
Lee Davis - 2015-08-31 19:06:29 - In reply to message 4 from Ashraf Gheith
I'd recommend sooner than later as far as moving into PDO. By the time PHP 7 is out, PDO will be as common as MySQL used to be. I'm already ahead of the curve on that one, and getting into specializing in converting web apps from MySQL to PDO. I can't begin to tell you how happy I am that I made that investment of time to learn it. Just a suggestion.