Connecting to a Database 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 was deprecated in PHP 5.5 and will be removed at some unspecified date in the future. It’s not covered in this book.