IMxSOxCOOL Posted May 21, 2014 Share Posted May 21, 2014 Every time i try to fix this i keep getting this Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'asdasd'@'localhost' (using password: YES)' in /home/u345945996/public_html/includes/db.php:7 Stack trace: #0 /home/u345945996/public_html/includes/db.php(7): PDO->__construct('mysql:host=loca...', 'asdasd', 'nasdas') #1 /home/u345945996/public_html/index.php(3): require_once('/home/u34594599...') #2 {main} thrown in /home/u345945996/public_html/includes/db.php on line 7 Can someone help me fix this??? Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/ Share on other sites More sharing options...
Jacques1 Posted May 21, 2014 Share Posted May 21, 2014 You have a database user called “asdasd” with the password “nasdas”? Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480244 Share on other sites More sharing options...
bsmither Posted May 21, 2014 Share Posted May 21, 2014 Usually, the message:Access denied for user 'asdasd'@'localhost' (using password: YES)means that, even though a password is being supplied, the problem is...* the username is not recognized by the database server* the password is not recognized by the database server* the database being connected to does not have permission to let this user access it as per the database server* the database server has been told to only allow this user access from a particular computer, other than localhost Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480245 Share on other sites More sharing options...
IMxSOxCOOL Posted May 21, 2014 Author Share Posted May 21, 2014 ok i fixed that now i get this error Parse error: syntax error, unexpected '[' in /home/u345945996/public_html/inc/classes/resolvers/skype.class.php on line 14 heres what i have in skype.class.php <?php class SkypeResolver { function __construct($db) { $this->db = new DB($db); } function get_ip($username) { $str = $this->skypeurl(); $str .= $username; $output = file_get_contents($str); return $output; } function skypeurl() { return $this->db->fetch_array($this->db->query("SELECT * FROM `settings` WHERE `ident`='skype-api-url'"))['val']; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480361 Share on other sites More sharing options...
Jacques1 Posted May 21, 2014 Share Posted May 21, 2014 You can't apply the bracket syntax to function call expressions unless you have PHP 5.4 or greater (obviously you don't). This doesn't look right, anyway. But I can't tell you without seeing your DB class. Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480362 Share on other sites More sharing options...
boompa Posted May 21, 2014 Share Posted May 21, 2014 (edited) $this->db->fetch_array($this->db->query("SELECT * FROM `settings` WHERE `ident`='skype-api-url'")) This construct sucks anyway, because what if the query fails? Edited May 21, 2014 by boompa Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480363 Share on other sites More sharing options...
IMxSOxCOOL Posted May 21, 2014 Author Share Posted May 21, 2014 here is the db.class.php <?php class DB { function __construct($db) { $this->error = new Error(); $this->mysqli = new mysqli($db['host'], $db['user'], $db['pass'], $db['name']); if($this->mysqli->connect_error) { $this->error->connect_error(); } } function query($i) { return $this->mysqli->query($i); } function fetch_array($i) { return $i->fetch_array(MYSQLI_ASSOC); } function num($i) { return $i->num_rows; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480369 Share on other sites More sharing options...
IMxSOxCOOL Posted May 21, 2014 Author Share Posted May 21, 2014 ok i fixed that now i get this error Parse error: syntax error, unexpected '[' in /home/u345945996/public_html/inc/classes/resolvers/skype.class.php on line 14 heres what i have in skype.class.php <?php class SkypeResolver { function __construct($db) { $this->db = new DB($db); } function get_ip($username) { $str = $this->skypeurl(); $str .= $username; $output = file_get_contents($str); return $output; } function skypeurl() { return $this->db->fetch_array($this->db->query("SELECT * FROM `settings` WHERE `ident`='skype-api-url'"))['val']; } } ?> Ok i found my mistake in that one i added a little too much in to it. now once i fixed it i got this one. Deprecated: Function ereg_replace() is deprecated in /home/u345945996/public_html/inc/classes/resolvers/cloudflare.api.php(1) : eval()'d code on line 1 cloudflare.api.php <?php $_F=__FILE__;$_X='Pz48P3BocA0KLy81cnIycl9yNXAycnQ0bmcoMCk7DQoNCg0KY2wxc3MgQ2wyM2RmbDFyNUFQSSB7DQoJcHI0djF0NSBmM25jdDQybiAxbGxfY2ZfNHAoJHIxbmc1KQ0KC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Sgkcl80cCwgJHRoNHMtPjFsbF9jZl80cCgiNjkwIikpOg0KCQkJCQkJCQkJCQkJCQkxcnIxeV9wM3NoKCRuMm5fNHAsICRyX2gyc3QpOw0KCQkJCQkJCQkJCQkJCWJyNTFrOw0KCQkJCQkJCQkJCQkJDQoJCQkJCQkJCQkJCX0NCgkJCQkJCQkJCQk0Zig0bl8xcnIxeSgkcl9oMnN0LCAkbjJuXzRwKSA9PSBmMWxzNSkNCgkJCQkJCQkJCQkJew0KCQkJCQkJCQkJCQkJMXJyMXlfcDNzaCgkcjUxbF80cCwgJHJfNHApOw0KCQkJCQkJCQkJCQl9DQoJCQkJCQkJCQl9IH0NCgkJNGYoITVtcHR5KCRyNTFsXzRwKSkgew0KCQkJcjV0M3JuIDRtcGwyZDUoIiwgIiwgMXJyMXlfM240cTM1KCRyNTFsXzRwKSk7DQoJCX0gNWxzNSB7DQoJCQlyNXQzcm4gIlVuMWJsNSB0MiByNXMybHY1IElQIjsNCgkJfQ0KCX0NCn0NCj8+';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?> Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480371 Share on other sites More sharing options...
jazzman1 Posted May 21, 2014 Share Posted May 21, 2014 You need to change the call to all ereg_* functions to preg_* instead. http://php.net/manual/en/function.preg-replace.php Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480373 Share on other sites More sharing options...
IMxSOxCOOL Posted May 21, 2014 Author Share Posted May 21, 2014 thanks bro for that but now i got this now. Warning: mysqli::mysqli(): (42000/1203): User u345945996_admin already has more than 'max_user_connections' active connections in /home/u345945996/public_html/inc/classes/db.class.php on line 7 MySQLi Connection Error Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480374 Share on other sites More sharing options...
jazzman1 Posted May 22, 2014 Share Posted May 22, 2014 http://dev.mysql.com/doc/refman/5.0/en/user-resources.html Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480377 Share on other sites More sharing options...
IMxSOxCOOL Posted May 22, 2014 Author Share Posted May 22, 2014 http://dev.mysql.com/doc/refman/5.0/en/user-resources.html i still get the error maybe im looking at it wrong??? Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480379 Share on other sites More sharing options...
jazzman1 Posted May 22, 2014 Share Posted May 22, 2014 How many number of times this account can connect to the server within one hour? Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480380 Share on other sites More sharing options...
IMxSOxCOOL Posted May 22, 2014 Author Share Posted May 22, 2014 idk how do i check, and is there anyway for me to show you it like by skype or teamviewer??? Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480385 Share on other sites More sharing options...
jazzman1 Posted May 22, 2014 Share Posted May 22, 2014 I've stopped using any proprietary sofware like skype and teamviewer many years ago idk how do i check ..... Start, explaining us, why are you using mysqli and pdo libraries at the same time? Or, you fixed the issue from your first post replacing pdo with mysqli? Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480386 Share on other sites More sharing options...
IMxSOxCOOL Posted May 22, 2014 Author Share Posted May 22, 2014 I've stopped using any proprietary sofware like skype and teamviewer many years ago Start, explaining us, why are you using mysqli and pdo libraries at the same time? Or, you fixed the issue from your first post replacing pdo with mysqli? i just changed the whole sql Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480390 Share on other sites More sharing options...
jazzman1 Posted May 22, 2014 Share Posted May 22, 2014 Make sure you use only one library when dealing with DB server in this project. You also need to create one mysqli object to instantiate only one connection per user, then pass that DB object among all the classes that need to use it. Quote Link to comment https://forums.phpfreaks.com/topic/288640-fatal-error/#findComment-1480424 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.