ummmm ... well if you just want to connect to mySQL and then connect to your database.
then do the following:
$id_link = @mysql_connect('localhost', 'username', 'password');
if (! $id_link) {
echo 'sorry, connection failed!';
exit();
}
mysql_select_db('your_db_name');
thats it, after this do your nice stuff with the db, and then to close the db link do the following:
mysql_close();
enjoy!