Up-to-date book on PHP/MySQL

It looks like my PHP/MySQL code includes deprecated code. For instance, the connect code is different when using MySQLi. Can anyone point me to a reference book that includes only the best current practices for PHP/MySQL so I can learn and update my skills? I know the PHP and MySQL sites have the updated information, but I prefer the structured book format of learning.

I’d recommend http://www.sitepoint.com/books/phpmysql5/

Now, the reasons are 1) it utilizes PDO (which is becoming the norm on some level), and 2) it will help you write your sites in a much more organizational manner (think MVC or PAC).

I think the book would be a great start point for you to get yourself to the next level. It may feel a bit of a back step in some ways, but I think if you give it a solid effort, you’ll learn a lot.

I wondered whether the book is updated with MySQLi or not, that’s why I haven’t bought it yet.

Yes, it actually uses PDO instead of MySQLi directly (although there may be a reference or two to MySQLi). PDO in my opinion will likely replace MySQLi over the next 3-4 major versions of PHP occur (so a few years from now). It definitely does not use MySQL functions.

Yes, it actually uses PDO instead of MySQLi directly (although there may be a reference or two to MySQLi). PDO in my opinion will likely replace MySQLi over the next 3-4 major versions of PHP occur (so a few years from now). It definitely does not use MySQL functions.