I have a navigation page script that returns 65 entries per page on my website. It worked fine until my hosting provider moved me to another server. Now, when I go to the page, I get the following error:
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();
Line 34 of page page.php:
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]; }
Obviously, I have the correct credentials to log in to the database, but they seem to ignore them and try to log in with the username root.
Is this a problem for my hosting provider and how do they have a server installed?
source share