And for something more usefull, to use it as a function so you can call it when you need it.
function db_connect() {
$connect = mysql_connect("localhost", "username", "password", );
if(!mysql_select_db("database"))
{
return false;
} else {
return $connect;
}
}