Issue connecting to a database.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
windwaker
Forum Newbie
Posts: 21
Joined: Sun Feb 13, 2005 11:18 am

Issue connecting to a database.

Post by windwaker »

I keep getting the error "Access denied to x, Using password: NO"... Does anyone know what's wrong with this? o_O A password was input.

Edit: misspelled a variable. I had checked for this, too. :(
User avatar
smpdawg
Forum Contributor
Posts: 292
Joined: Thu Jan 27, 2005 3:10 pm
Location: Houston, TX
Contact:

Post by smpdawg »

For testing and development you should turn on error reporting. This will make problems like that stand out.

error_reporting(E_ALL);

http://us2.php.net/error_reporting
thegreatone2176
Forum Contributor
Posts: 102
Joined: Sun Jul 11, 2004 1:27 pm

Post by thegreatone2176 »

showing your mysql_connect statement would also help
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

the connection for your database should look like this

Code: Select all

$handle = mysql_connect("localhost", "username", "password");
mysql_select_db("database_name", $handle);
Using Password: No, means that you didn't supply a password or your page is not reading the database connection.
Post Reply