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 ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.