December 2002
Beginner
640 pages
16h 41m
English
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.
Table 11.2 shows the functions for connecting to and disconnecting from a MySQL database server and for selecting a database.
| Function | Action |
|---|---|
| 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 ...