Connecting to the MySQL Server
Before you can perform any operation on a database you must connect to the MySQL server. The syntax for performing this operation is simple.
A simplified version of the code is shown below.
$link = mysql_connect("localhost","username","password"]) or die("Connect Error: " . mysql_error());
print "Successfully connected.\n";