The PHP API for MySQL
PHP has a suite of built-in functions for interfacing with MySQL database servers. You can get by with a small subset of them, but we'll try to cover the full function list for completeness.
Connecting to a MySQL Database
Table 11.2 shows the functions for connecting to and disconnecting from a MySQL database server and for selecting a database.
|mysql_connect()||Opens a connection to a MySQL server|
|mysql_pconnect()||Opens a persistent connection to a MySQL server|
|mysql_select_db()||Selects a MySQL database|
|mysql_close()||Closes a connection to a MySQL server|
You can use the following syntax to connect to a MySQL server:
mysql_connect ([server[,username[,password ...