Just like files, we need to first establish a connection to the database and get a handle to use:
$linkID = mysql_connect("hostname", "userName", "password");
mysql_connect needs 3 arguments:
Now that we have a handle to the database () we can do a few things:
The first of these is usually for checking permissions and general information. For the most part we will be working with mysql_select_db("dbName",) in this class.
So, to establish a connection and select a database, our php looks like this...
<?php $linkID = mysql_connect("hostname","username","password"); mysql_select_db("myDatabaseName",$linkID); ?>;NEXT