1. Never suppress warnings, only in production mode...
2. intval isn't a real solution as it's a error within the database.
Have you ever checked wether there is a column named maintenance within site_config?
If it's there then try what this code says:
PHP Code:
public static function GetMaintenanceStatus()
{
$sql = dbquery("SELECT maintenance FROM site_config LIMIT 1");
if(!$sql)
echo mysql_error();
else
echo "MYSQL SEEMS OK";
if(mysql_num_rows($sql) != 1)
echo "MYSQL DOES NOT RETURN ANYTHING";
else
echo "EVERYTHINGS OK";
}
return mysql_result($sql,0);
}