I have PHP file where I have defined the server access variables as well as the mysql_connect and mysql_select_db, as this functions are regularly
mysql_connect
mysql_select_db
You should use include_once() if you're including it more than once on a page.