OK - thanks misson.
I have done most of what you suggest...
constructor now has a different name and class/functions are now fomratted as you suggest.
In the class_db_connect.php connection file I have this..
PHP Code:
<?php
$hostname_discountdomains = "XXXX";
$username_discountdomains = "XXXX";
$password_discountdomains = "XXXX";
$database_discountdomains = "XXXXX";
global $database_discountdomains;
$discountdomains = mysql_connect($hostname_discountdomains, $username_discountdomains, $password_discountdomains) or trigger_error(mysql_error(),E_USER_ERROR);
global $discountdomains;
?>
Then in the class...
PHP Code:
require('http://www.qualityimagesearch.com/Connections/class_db_connect.php');
mysql_select_db($GLOBALS['database_discountdomains'], $GLOBALS['discountdomains']);
$query_compImage = "SELECT * FROM IMGCOMPS";
$compImage = mysql_query($query_compImage, $GLOBALS['discountdomains']) or die(mysql_error());
$row_compImage = mysql_fetch_assoc($compImage);
$totalRows_compImage = mysql_num_rows($compImage);
This seems to work!!
I'm assuming there is no way to access the local variables in the connection file?? I also hope there is no reason not to disclose the database name as a global? (which anyone could access!).
I'm afraid I didn't follow your second suggestion of a db connection class... 
Thanks for getting this far - at least I have something that works!
Richard