Lesson 24. Using MySQL with PHP

In this lesson, you learn how to communicate with a MySQL database from a PHP script.

PHP actually has two different APIs for MySQL, both of which are covered in this chapter. The first, mysql, is the classic set of functions that are available in all versions of PHP.

The new interface is mysqli, which stands for MySQL Improved. It is available only in PHP version 5 and works only with MySQL version 4.1 and higher. The mysqli interface can be used through a set of functions or in an object-oriented manner, to fit the improved OO capabilities of PHP 5.

Get Sams Teach Yourself MySQL 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.