Thanks, is this how its done?..
<? include "/link/to/db.inc";
$db = mysql_connect($dbhost,$dbuser,$dbpass) or die ("Unable to connect to the server. ".mysql_error());
mysql_select_db($dbname) or die ("Unable to connect to the database. ".mysql_error());
$result = mysql_query("SELECT * FROM mos_comprofiler, mos_users",$db);
$myrow = mysql_fetch_array($result) or die ("Unable to execute. ".mysql_error());
$tourPref = $myrow["tourPref"];
%>