( ! ) Warning: mysql_query() [function.mysql-query]: Access denied for user ''@'localhost' (using password: NO) in C:\wamp\www\hacks4all.wapzan.com\registration\register.php on line 40
( ! ) Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\hacks4all.wapzan.com\registration\register.php on line 40
I tried to fix it by changing the code in:
// dbConfig.php is a file that contains your
// database connection information. This
// tutorial assumes a connection is made from
// this existing file.
// Replace the variable values below
// with your specific database information.
$host = "localhost";
$user = "root";
$pass = "CENSORED";
$db = "CENDORED";
// This part sets up the connection to the
// database (so you don't need to reopen the connection
// again on the same page).
$ms = mysql_pconnect($host, $user, $pass);
if ( !$ms )
echo "Error connecting to database.\n";
// Then you need to make sure the database you want
// is selected.
When I do that the only thing I see is:
Error: User not added to database.
ps. I think that it's my WAMP server that isn't fully on since it's yellow, probably SQL is offline?
seems that your problem is that you can't connect with those details, so any calls to mysql_ functions will also throw an error. Check your connection details. Try it from phpmyadmin or your favourite mysql GUI.
**If WAMP shows yellow - it probably means something bad. I use XAMPP, so I can't really comment, but do you have to manually start the mysql server? E.g. by clicking a button?
dbConfig.php is placed with the other files but I can make it skip the problem by adding the information directly into register.php and forget the dbconfig.php
but the error after the registration still exists. I think it's WAMP.
It usually starts by itself, but I can do it manually by pressing "Start all services"
Which includes php and mysql. At the loading point it doesn't turn green, just yellow which is half the services on.
Maybe a conflicting port? I am able to access my db on another computer using my WAN ip and the port 3306.
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.