http://www.devshed.com/c/a/MySQL/Bui...in-PHPMySQL/1/
This is little bit how I do my coding
I have a php file that holds all my login info then use "include" statement to connect to my db.
<?
$dbhost = "local"; // database hostname
$dbuser = "merz"; // database username
$dbpassword = "mypassword"; // database password
$dbname = "blah"; // database name
?>
I save that as a file like connect.php
Then when I code another page I do something like this:
<?
include("connect.php");
$dbh=mysql_connect ($dbhost, $dbuser, $dbpassword) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($dbname,$dbh);