Chapter 11. Connecting to MySQL with PHP and SQL

Connecting to MySQL with PHP and SQL

PHP offers three different ways to connect to and interact with a MySQL database: the original MySQL extension, MySQL Improved (MySQLi), or PHP Data Objects (PDO). Which one you choose is an important decision, because they use incompatible code. You can't mix them in the same script. The original MySQL extension is no longer actively developed and is not recommended for new PHP/MySQL projects. It's not covered in this book.

The PHP documentation describes MySQLi as the preferred option recommended by MySQL for new projects. However, that doesn't mean you should discount PDO. The advantage of PDO is ...

Get PHP Solutions: Dynamic Web Design Made Easy, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.