jimgilbert Posted January 4, 2009 Share Posted January 4, 2009 Hi all, I am a newbe and am working on a login routine. I cannot get connected to the database. I have tried several different names and things but I keep getting the same error:Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'agent99'@'localhost' (using password: YES) in /home/realesv3/public_html/theclienttracker/checklogin.php on line 12cannot connectThis is the code I have now: <?phpob_start();$host="localhost"; // Host name$username="agent99"; // Mysql username$password="agent99"; // Mysql password$db_name="realesv3_sunday"; // Database name$tbl_name="members"; // Table name// Connect to server and select databse.mysqli_connect("$host", "$username", "$password")or die("cannot connect"); mysqli_select_db("$db_name")or die("cannot select DB"); Any ideas?Thanks! Link to comment Share on other sites More sharing options...
jimgilbert Posted January 4, 2009 Author Share Posted January 4, 2009 I figured it out. I had to add the "realesv3_" to the user name as well as the db name. At hostmonster anyway, the user name gets the prefix added to it when you save it. Link to comment Share on other sites More sharing options...
Synook Posted January 5, 2009 Share Posted January 5, 2009 Most hosts do that if you are on a shared server... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.