2 ways but I'm not sure if they both refer to the same type of SQL databases. The first one is:
$linkID = @mysql_connect($dbhost,$accountname,$password)
or die("Could not connect to MySQL server");
@mysql_select_db($database) or die("Could not select database");
And the second is MySQLI and I think might be as follows:
$linkID = @mysqli_connect($dbhost,$accountname,$password,$database)
or die("Could not connect to MySQL server");
@mysqli_select_db($linkID,$database) or die("Could not select database");
The first one i think is more common.