I\'ve read a LOT of things about this problem, however I still cannot fix it.
In my functions file I declare a variable with a value like so:
$px_host =
If you set the variable global, you will need to set it global in the function as well. In this case:
$px_host = "localhost";
function dbQuery($database, $reqquery){
global $px_host;
if(!$connect = mysql_connect($px_host, $px_dbuser, $px_dbpass)){
exit("Error - cannot connect to MySQL server - " . mysql_error());
}
if(!$database = mysql_select_db($database)){
exit("Error - cannot select database - " . mysql_error());
}
if(!$query = mysql_query($reqquery)){
exit("Error - query error.");
}
return $query;
}
This should fix this problem.