Hi all. I'm having a very strange issue with PHP/MySQL that I'm hoping someone can help with.
I'm in the process of writing a series of six web application, and one administrative application, and I'm performing authentication for each with a class I wrote. I'm using php ADODB for db connectivity.
Now, when I log in as the administrator, it logs me in without trouble, but when I get redirected to the administrative area, I get the following error when attempting to build the admin interfaces:
Warning: Access denied for user: 'webapps_admin@localhost' (Using password: YES) in c:\phpdev\www\adodb\drivers\adodb-mysql.inc.php on line 115
Now, I'm fully aware that this is telling me the username and password for the user webapps_admin aren't working properly, but the thing is, the UN/PW are correct!!!
In the admin interface, I'm connecting to the DB using the following code:
define ("webapps_login","webapps_admin"); define ("webapps_pass","gooneygoogoo");
$conn->PConnect('localhost',webapps_login,webapps_pass,'communic');
So I've set the named constants, and am attempting to use them in the connection string, but I always get the above error.
Now, the reason I'm so flustered is three-fold:
1) I use this same format in a number of other places throughout these applications and it works fine.
2) If I actually hard code the values I set in the named constants into the connection string, it works fine.
3) If I connect to mysql through the command line with the un/pw for webapps_admin, it works fine.
I've been looking at this code for far too long now, so it's probably something simple that I'm missing.
Does anyone have an idea why it wouldn't work when I used the named constants (though as I said, I use them elsewhere in connection strings and it works fine), but when I hard code it in or connect through the command line it works fine?
Thanks in advance,
P.