时间:2021-07-01 10:21:17 帮助过:16人阅读
$this->conn = mysql_connect($this->db_host, $this->db_user, $this->db_pwd) ;
if ( !($this->conn) )
{
die('Could not connect:'. mydsql_error('连接出错')) ;
}
拼写错误
观察到
'noco '@'14.210.115.31'
和
'noco'@'14.210.115.31'
的区别
显然是多了空格、回车、换行之类的字符
你是怎么读取 ini 文件的?
读取文件方式:
$this->db_host = fgets($openfile) ;
$this->db_user = fgets($openfile) ;
$this->db_pwd = fgets($openfile) ;
那是要去掉尾部的空白字符的(空格、回车、换行)
$this->db_host = trim(fgets($openfile)) ;$this->db_user = trim(fgets($openfile)) ;$this->db_pwd = trim(fgets($openfile)) ;
显然 'noco '@'14.210.115.31' 用户名后面多了个空格。