Respectively:
- I don't know, are you?
- Because the username/password combination isn't a valid login to MySQL.
- Probably not, actually. But it wouldn't be a problem.
- Maybe.
- Try taking the error message at face value.
I'm sorry, this really has my head spinning... The following code works, successfully connecting to the database:
if($_POST['passwd'] == $_POST['passwd2']) {
$test = db_query("SELECT * FROM INVENTORY WHERE INV_ID = 1");
echo $test[0]['NAME'];
$passwd = $_POST['passwd'];
However if I change the code ever so slightly, it doesn't work, giving me the connection error:
if($_POST['passwd'] == $_POST['passwd2']) {
$passwd = $_POST['passwd'];
$test = db_query("SELECT * FROM INVENTORY WHERE INV_ID = 1");
echo $test[0]['NAME'];
I don't get it...
EDIT: oh my god... I just realized I'm resetting the $passwd variable... Same variable I previously set for the database connection. DUH.. Thanks for the help...