0
<?
$conn = mysql_connect("localhost", "your_username","your_password") or die(mysql_error());
mysql_select_db('your_database', $conn) or die(mysql_error());
?>

this is the code i have on database.php, when i run register page i get a erro.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'your_username'@'localhost' (using password: YES) in /home/a4595523/public_html/database.php on line 2
Access denied for user 'your_username'@'localhost' (using password: YES)

what should i do / change?

5
Contributors
5
Replies
7
Views
8 Years
Discussion Span
Last Post by ray101
0

That error means, that with the data provided

"localhost", "your_username","your_password"

you are not able to connect to a database. I do strongly think, that you specially changed the data for us not to see it, but if you really wrote

"localhost", "your_username","your_password"

then, you should use the real data, which would be able to connect you to your database. So, if

"localhost", "your_username","your_password"

is NOT the data, you are connecting with, make sure you spelled it correctly or whether such user exists on your database(if not - create one).

0

You need to replace 'your_username' and 'your_password' with the username and password for the MySQL database.

-1

PLEASE HOW DO I ADD EMAIL ADDRESS TO MY PHP TO ALLOW SUBMITTED FORM COME TO MY EMAIL? SEE CODE BELOW...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.