|
|
PHP is one of the most popular languages to use with MySQL, particularly in a web environment. This appendix lists all the PHP functions that work with MySQL—including some not yet in the release version of PHP.
The PHP configuration file is called php.ini, and it has a number of options specific to MySQL. These include the following:
mysql.allow_persistent boolean This is On if persistent connections to MySQL are allowed. Defaults to On. There's usually no reason to switch this off.
mysql.max_persistent integer The maximum number of persistent connections for each process. Defaults to –1 (no limit).
mysql.max_links integer The maximum number of MySQL connections of all types for each process. Defaults to –1 (no limit).
mysql.default_port string The default TCP port number on which to connect to MySQL. PHP will use the MYSQL_TCP_PORT environment variable if no default is set. Unix can also use, in order, the mysql-tcp entry in /etc/services or the compile-time MYSQL_PORT constant. Defaults to NULL.
mysql.default_socket string The default Unix socket name to use to connect to MySQL. Defaults to NULL.
mysql.default_host string The default hostname to use to connect to MySQL. Safe-mode will invalidate this option. Defaults to NULL.
mysql.default_user string The default username to use to connect to MySQL. This doesn't apply in Safe mode, which will invalidate this option. Defaults to NULL.
mysql.default_password string The default password to use to connect to MySQL. Doesn't apply in Safe mode, which will invalidate this option. Defaults to NULL. Not recommended to store a password here!
mysql.connect_timeout integer The connection timeout in seconds.
|
|