Swipe to navigate through the chapters of this book
PHP 7 offers two ways to connect to and interact with a MySQL database: MySQL Improved (MySQLi) and 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 database connection. It’s also important not to confuse MySQLi with the original MySQL extension, which is no longer supported in PHP 7. In most cases, the only difference in the names of MySQLi functions is the addition of the letter I (e.g., mysqli_query() instead of mysql_query()). However, the order of arguments is usually different, so converting an old script involves more than just inserting an I into the function name.
Please log in to get access to this content
To get access to this content you need the following product:
- Connecting to a Database with PHP and SQL
- Sequence number
- Chapter number
- Chapter 13