I'm a little dim when it comes to this and can replace where advised but this produces further errors. If someone could assist it would be appreciated.
Ignoring the error fails also (and from what I read shouldn't be used anyway).
I replaced with mysqli_connect and added $sys_dbname but then failed again with the error check for the mysql_select_db which reported requiring a string given. Changed to mysqli_select_db and still the same output.
Can someone quickly fix the code below for me? Thanks Dave
function db_connect()
{
global $host,$user,$pwd,$errstr,$sys_dbname,$port;
$strhost=$host;
if($port && $port!=3306)
$strhost=$strhost.":".$port;
$conn = mysql_connect($strhost,$user,$pwd);
if (!$conn || !mysql_select_db($sys_dbname,$conn))
{
trigger_error(mysql_error(), E_USER_ERROR);
}
return $conn;
}
function db_close($conn)
{
return mysql_close($conn);