0
votes

Here's my code

<?php
$host = 'localhost';
$username = 'sam_sam';
$password = '[censored]';
$name = 'sam_ballpointradio';
mysql_connect($host, $db_username, $db_password)
or die(mysql_error());
mysql_select_db($db_name) or die(mysql_error());
?>

and the error message is

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'sam'@'localhost' (using password: NO) in /home/sam/public_html/ballpointradio/db_config.php on line 6
Access denied for user 'sam'@'localhost' (using password: NO)

I know all the information is correct, but it's a weird error because it says I'm NOT using a password, but I am...

1
No, you aren't using a password. The variable name is misspelled. - svens
Wow...I am an idiot.... ..thanks - Sam

1 Answers

8
votes

Variable naming problem ?

mysql_connect($host, $username, $password)