PHP ManualMySQL Improved ExtensionIntroductionThe mysqli extension allows you to access the functionality provided by MySQL 4.1 and above. More information about the MySQL Database server can be found at » http://www.mysql.com/ Documentation for MySQL can be found at » http://dev.mysql.com/doc/. Parts of this documentation included from MySQL manual with permissions of MySQL AB. RequirementsIn order to have these functions available, you must compile PHP with support for the mysqli extension.
InstallationTo install the mysqli extension for PHP, use the --with-mysqli=mysql_config_path/mysql_config configuration option where mysql_config_path represents the location of the mysql_config program that comes with MySQL versions greater than 4.1. If you would like to install the mysql extension along with the mysqli extension you have to use the same client library to avoid any conflicts. Installation on Windows SystemsMySQLi is not enabled by default, so the php_mysqli.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.
As with enabling any PHP extension (such as php_mysqli.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext
Runtime ConfigurationThe behaviour of these functions is affected by settings in php.ini.
For further details and definitions of the above PHP_INI_* constants, see the chapter on configuration changes. Here's a short explanation of the configuration directives.
Predefined ClassesmysqliRepresents a connection between PHP and a MySQL database. Constructor
Methods
Properties
mysqli_stmtRepresents a prepared statement. Methods
Properties
mysqli_resultRepresents the result set obtained from a query against the database. Methods
Properties
Predefined Constants
ExamplesAll Examples in the MySQLI documentation use the world database from MySQL AB. The world database can be found at » http://dev.mysql.com/get/Downloads/Manual/world.sql.gz/from/pick Table of Contents
|
PHP-Index
New Tutorial entries
|







