colap Posted November 3, 2009 Share Posted November 3, 2009 <?php class cl_ { public function fc() { $host="localhost"; $user="root"; $password="aaaaaaaaa"; $database_name="a"; mysql_connect("$host","$user","$database_name")or die('Could not connect: ' . mysql_error()); mysql_select_db("a"); } } ?> Link to comment https://forums.phpfreaks.com/topic/180202-solved-could-not-connectaccess-denied-for-user-rootlocalhost-using-password-yes/ Share on other sites More sharing options...
marcus Posted November 4, 2009 Share Posted November 4, 2009 mysql_connect uses the parameters in this order: host, username, password you have it: host, username, database? Link to comment https://forums.phpfreaks.com/topic/180202-solved-could-not-connectaccess-denied-for-user-rootlocalhost-using-password-yes/#findComment-950607 Share on other sites More sharing options...
colap Posted November 4, 2009 Author Share Posted November 4, 2009 Solved Link to comment https://forums.phpfreaks.com/topic/180202-solved-could-not-connectaccess-denied-for-user-rootlocalhost-using-password-yes/#findComment-950612 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.