I am getting this warning on line 25:
Warning :
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' >(using password: NO) in C:\xampp\htdocs\shadaab\register.php on line 25Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs开发者_Python百科\shadaab\register.php on line 25 Access denied for user 'ODBC'@'localhost' (using password: NO)"
I have following SQL query on line 25:
$result=mysql_query("SELECT email FROM user WHERE email='$email'")or die(mysql_error());
The error message means:
- You have not connected to database (using
mysql_connect
andmysql_select_db
) - If you have specified
mysql_connect
, you are not specifying correct username and password to themysql_connect
function.
Here is how you can connect to your db before running your SQL queries:
$con = mysql_connect('server address', 'username', 'password') or die(mysql_error());
mysql_select_db('your db name') or die(mysql_error());
More information on official documentation.
It seems that you provide invalid data in mysql_connect. Check user/password.
Looks like a connection problem, check that you are calling mysql_connect
above that line, and that your settings (password, host name, database name) and permissions are correct. Docs
精彩评论