mentaljason Posted June 12, 2008 Share Posted June 12, 2008 Okay i just done sumat and i can't conect to db. what goes where?? <?php $c = mysql_connect('localhost', 'myusername', 'mypassword'); mysql_select_db('mydatabase', $c); $mykey=123456789; ?> here's my error....... Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myusername'@'localhost' (using password: YES) in /home/a1100261/public_html/mysql.php on line 2 and Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/a1100261/public_html/mysql.php on line 3 Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'myusername'@'localhost' (using password: YES) in /home/a1100261/public_html/mysql.php on line 2 And many more, i think it's the conection. any help??? Masked connection details Quote Link to comment Share on other sites More sharing options...
Floydian Posted June 12, 2008 Share Posted June 12, 2008 Re: Conecting????? Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'blah blah'@'localhost' (using password: YES) in /home/a1100261/public_html/mysql.php on line 2 For that one, your password is wrong, or your user name is wrong. Check your cpanel for the correct info. and Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/a1100261/public_html/mysql.php on line 3 Fix the thing that's causing the first error, and this one won't be a problem. Incidentatlly, I doubt your user name is the same as the database name, so that may be incorrect. It is possible though that they are the same. It's not best to do it that way though, hence why I suspect that may be part of your problem. Double check your info ;) Quote Link to comment Share on other sites More sharing options...
Undergroundcity Posted August 23, 2008 Share Posted August 23, 2008 Re: Conecting????? I had the same problem too. there are 3reasons: 1. Your database or username is too long. 2. You did not allow allow the username to connect to the databse 3.you didn't set mysql.php's permissions to 0777. Quote Link to comment 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.