Make a file called functions.php or something, and throw this function in there.
function loadconfig()
{
$mydb = mysql_pconnect($dbhost,$dbuser,$dbpass);
if (!$mydb) { die("Couldn't connect to the database."); }
mysql_select_db($dbname);
$result = mysql_query("SELECT * FROM dbname WHERE something='$thisvariable'");
if (!$result) { die("error getting stuff"); }
global $configdata
$configdata=mysql_fetch_array($result);
}
Then, include the functions.php script in all other php files and only call the function once (to read data). Once the function has been called, the $configdata array will be filled, and it can be called by any script (that has included functions.php) like this:
echo ($configdata["columnname"]);
Be sure to change all those variables and stuff.
Good luck!