Well, I was trying to create a user authentication system, but I've run into a problem, namely that I cannot connect to the database.
Here's the code I think is necessary:
//Database Information
$db_host = 'localhost';
$db_name = 'dbname';
$db_user = 'username';
$db_pass = 'password';
//Some code I left out
mysql_connect($db_host, $db_user, $db_pass) or die ('Could not connect to server.<br />');
Here's the output:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\epostal\auth.php on line 29
Could not connect to server.
Some facts that may help:
My username definitely isn't ODBC, and I've definitely supplied a password.
My username and password are both correct.
I can login MySQL via the command prompt with that account.
The account has the correct privileges (SELECT, INSERT, UPDATE, DELETE) for that database.
If I enter the username, password and host directly into mysql_connect() The error message remains almost identical - the only thing that changes is that the correct username is reflected.
I have tried restarting both Apache and MySQL.
I have tried FLUSH PRIVILEGES.
MySQL version: 5.0?? (Can't remember or find exact version)
Apache version: 2.2.3