Create a php document and put code in it:
$hostname_bgweb = "localhost";
$database_bgweb = "database name";
$username_bgweb = "database user name";
$password_bgweb = "database password";
$bgweb = mysql_pconnect($hostname_bgweb, $username_bgweb, $password_bgweb) or trigger_error(mysql_error(),E_USER_ERROR);
Just that text, nothing else.
Save this as (say) connect.php in a folder called Connections
Then at the beginning (first line) of any php page that needs to make a connection to your mySql database put the line:
<?php require_once('Connections/connect.php'); ?> (or whatever the path would be in relation to your page)
This is neater and easier in the long run, - DreamWeaver for example will look in the 'Connections' folder to see if you have a connection already set up, and will use it automatically as an option if ever you are creating code that requires calling on your mySql database.