帮助我收到此错误消息:
致命错误:无法使用第 64 行的 joomla\htdocs\ds\features\mysql.php 访问 D:\Installed Programs\deshoppy 中的空属性
下面是mysql.php:
<?php
// Give access to db information
global $db_type;
global $db_host;
global $db_user;
global $db_pass;
global $db_name;
// Connecting database
$db=mysql_connect($db_host,$db_user,$db_pass);
$db or die("Failed to connect database using $db_type :P");
// Selecting database
mysql_select_db($db_name) or
die('Failed to select database :P');
// Non OOP Functions
function db_query($q){
$qry=mysql_query($q);
return $qry;
}
function db_fetch_array($qry){
$qary=mysql_fetch_array($qry);
return $qary;
}
function db_num_rows($qry){
$qrnr=mysql_num_rows($qry);
return $qrnr;
}
function db_error(){
$db_error=mysql_error();
return $db_error;
}
function db_close(){
$db_close=mysql_close();
return $db_close;
}
// OOP
class aDatabase{
public $hostname="";
public $username="";
public $password="";
public $database="";
public $query=""; // Last SQL code
public $result=""; // Result of mysql_query
public $fetch_array=""; // Result of mysql_fetch_array
public $link=""; // Result of mysql_connect
public $num_rows=""; // Result of mysql_num_rows
public $error=""; // Result of mysql_error
public $disconnect=""; // Result of mysql_close
// Adding parameter to class
public function __construct($par_host, $par_user, $par_pass, $par_db){
$this->$hostname=$par_host;
$this->$username=$par_user;
$this->$password=$par_pass;
$this->$database=$par_db;
}
// Connect to database
function connect(){
$this->$link = mysql_connect(
$this->$hostname,
$this->$username,
$this->$password
);
return $this->$link;
}
// Fetch array
function fetch_array(){
$this->$fetch_array=mysql_fetch_array($this->$result);
return $this->$fetch_array;
}
function num_rows(){
$this->$num_rows = mysql_num_rows($this->$num_rows);
return $this->$num_rows;
}
// May not accurate to last error
function error(){
$this->$error = mysql_error();
return $this->$error;
}
function disconnect(){
$this->$disconnect = mysql_close($this->$link);
return $this->$disconnect;
$this->$link="";
}
}
// Proccess new database connection
$aDB=new aDatabase($db_host, $db_user, $db_pass, $db_name);
$aDB->connect();
// Clean database information to prevent hacking
$db_name="";
$db_user="";
$db_pass="";
$db_host="";
?>
在 ds_configuration.php 上(我之前忘了告诉这个):
<?php
// Site offline information
$site_offline=false;
$site_offline_title="Akdira";
// Database information
$db_user="root";
$db_pass="123456";
$db_name="deshoppy";
$db_host="localhost";
$db_type="mysql";
?>
你能告诉我如何解决它吗?