May 2003
Intermediate to advanced
592 pages
14h 28m
English
The first step when dealing with MySQL—connecting to the server—requires the appropriately named mysql_connect() function:
$dbc = mysql_connect ($host, $user, $password);
The arguments sent to the function (host, username, and password) are based upon the users and privileges set up within the mysql database (see Appendix A, “Installation,” for more information). Commonly, the host to specify will be localhost but not necessarily (specifying a different host will allow you to connect to MySQL running on a different server).
If the connection was made, the $dbc variable will become a reference point. Most of the PHP functions for working with MySQL can take this as an optional argument but, if ...
Read now
Unlock full access