我无法使用mysqli类登录数据库。
我遇到下一个错误:
Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO)
我有下一个代码:
$this->mysqlCon = new mysqli($siteConfig['db']['hostname'], $siteConfig['db']['username'], $siteConfig['db']['password'], $siteConfig['db']['database']);
var_dump()
的[$siteConfig['db']
返回:
array(4) {
["hostname"]=>
string(9) "localhost"
["username"]=>
string(4) "root"
["password"]=>
string(*) "***Censored***"
["database"]=>
string(*) "***Censored***"
}
我的VPS正在运行Debian 6 32位。
Warning: mysql_query()
^---------------------- notice something? :)
您似乎在代码中混用了mysql
和mysqli
。