我无法使用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']);
$siteConfig['db']
的var_dump()
返回:
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
。