Я получаю эти ошибки всякий раз, когда я регистрирую свой веб-сайт, он не сохраняет таблицу под cms_users, поэтому я не могу войти в систему.
[14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to MySQL server on 'SERVER IP' (4) in /home/blabbers/public_html/includes/classes.php on line 378 [14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/blabbers/public_html/includes/classes.php on line 379 [14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/blabbers/public_html/includes/classes.php on line 396 [14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_result() expects parameter 1 to be resource, null given in /home/blabbers/public_html/includes/classes.php on line 420 [14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/blabbers/public_html/includes/classes.php on line 396 [14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in /home/blabbers/public_html/includes/classes.php on line 400 [14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/blabbers/public_html/includes/classes.php on line 396 [14-Aug-2014 19:58:53 UTC] PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in /home/blabbers/public_html/includes/classes.php on line 400
[EDIT] Вот файл. Марио сказал мне, что этого недостаточно, надеюсь эта работа.
class HoloDatabase { var $connection; var $error; var $lastquery; function HoloDatabase($conn){ switch($conn['server']){ case "mysql": $this->connection = mysql_connect($conn['host'].":".$conn['port'], $conn['username'], $conn['password'], true); mysql_select_db($conn['database'],$this->connection) or $this->error = mysql_error(); break; case "pgsql": $this->connection = pg_connect("host=".$conn['host']." port=".$conn['port']." dbname=".$conn['database']." user=".$conn['username']." password=".$conn['password']); break; case "sqlite": $this->connection = sqlite_open($conn['host'], 0666, $this->error); break; case "mssql": $this->connection = mssql_connect($conn['host'].",".$conn['port'],$conn['username'],$conn['password'],true); break; } } } class mysql extends HoloDatabase { function query($query){ if(defined('DEBUG')){ $this->lastquery = $query; } $query = mysql_query($query,$this->connection); return $query; } function fetch_assoc($query){ $result = mysql_fetch_assoc($query); if(defined('DEBUG')){ $error = mysql_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function fetch_row($query){ $result = mysql_fetch_row($query); if(defined('DEBUG')){ $error = mysql_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function fetch_array($result,$result_type=0){ $result = mysql_fetch_array($result,$result_type); if(defined('DEBUG')){ $error = mysql_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function num_rows($query){ $result = mysql_num_rows($query); if(defined('DEBUG')){ $error = mysql_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function result($query,$row=0,$column=0){ $result = mysql_result($query,$row,$column); if(defined('DEBUG')){ if($result == false){ echo mysql_error($this->connection) . "<br />Query that errored: ".$this->lastquery; } } return $result; } function insert_id($query=null){ return mysql_insert_id($this->connection); } } class pgsql extends HoloDatabase { function query($query){ if(defined('DEBUG')){ $this->lastquery = $query; } $query = pg_query($this->connection,$query); return $query; } function fetch_assoc($query){ $result = pg_fetch_assoc($query); if(defined('DEBUG')){ $error = pg_last_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function fetch_row($query){ $result = pg_fetch_row($query); if(defined('DEBUG')){ $error = pg_last_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function fetch_array($result,$result_type=0){ $result = pg_fetch_array($result,null,$result_type); if(defined('DEBUG')){ $error = pg_last_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function num_rows($query){ $result = pg_num_rows($query); if(defined('DEBUG')){ $error = pg_last_error($this->connection); if($result == false && !empty($error)){ echo $error . "<br />Query that errored: ".$this->lastquery; } } return $result; } function result($query,$row=0,$column=0){ $result = pg_fetch_result($query,$row,$column); if(defined('DEBUG')){ if($result == false){ echo pg_last_error($this->connection) . "<br />Query that errored: ".$this->lastquery; } } return $result; } function insert_id($query){ return pg_last_oid($query); } }
Как это исправить?
Спасибо, Мэтью