我有一个页面导航脚本返回我的网站上共有65条记录每页。 它用来做工精细,直到我的托管服务提供商,让我感动到不同的服务器。 现在,当我去的网页,我得到以下错误:
Warning: mysqli::connect() [mysqli.connect]: (28000/1045): Access denied for user 'root'@'localhost' (using password: NO) in /home/jumbleweed/public_html/registry/browse_2004.php on line 10
Warning: mysqli::query() [mysqli.query]: invalid object or resource mysqli in /home/jumbleweed/public_html/registry/page.php on line 34
Line 9: $db = new mysqli('localhost', 'my_username', 'my_password', 'my_database');
Line 10: $db->connect();
page.php文件的第34行:
public function countRecords() {
//returns the number of records
global $db;
$count_query = "SELECT COUNT(*) FROM (".$this->query.") as temp";
Line 34: $result = $db->query($count_query);
$row = $result->fetch_row();
return $row[0];
}
很显然,我已经填充了连接到数据库的正确的登录凭据,但它似乎是忽略了他们,并试图用root作为用户名登录。
这是我的托管服务提供商,以及它们如何在服务器设置的问题?