Chapter 1 Introduction to the MySQL PHP API

PHP is a server-side, HTML-embedded scripting language that may be used to create dynamic Web pages. It is available for most operating systems and Web servers, and can access most common databases, including MySQL. PHP may be run as a separate program or compiled as a module for use with a Web server.

PHP provides four different MySQL API extensions:


The PHP documentation assumes PHP 7 and higher is used; functionality specific to PHP 5 and below is not documented.


This documentation, and other publications, sometimes uses the term Connector/PHP. This term refers to the full set of MySQL related functionality in PHP, which includes the three APIs that are described in the preceding discussion, along with the mysqlnd core library and all of its plugins.

The PHP distribution and documentation are available from the PHP website.

Portions of this section are Copyright (c) 1997-2021 the PHP Documentation Group This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution 3.0 License or later. A copy of the Creative Commons Attribution 3.0 license is distributed with this manual. The latest version is presently available at