database : mysql
tool: phpmyadmin
today my supervisor set up the web on the companies server. when its all settled, we try out the login page(index.php
) but we get fatal error and the line its pointing at refers to the connection.php
page which connects to the database.
Fatal error: Call to a member function quote() on a non-object = $dbh->quote($email); in index.php
connection.php:
<?php
$username = "username";
$password = "password";
try {
$dbh = new PDO('mysql:host=11.22.33.66;dbname=dbname', $username, $password);
$dbh->setAttribute(PDO::ERRMODE_WARNING, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e) {
echo "I'm sorry, I'm afraid i can't do that.";
file_put_contents('PDOErrors.txt', $e->getMessage(), FILE_APPEND);
$dbh = null;
}
?>
of course before this i was using xampp,localhost, so ive changed what needed to be changed: username, password, host and dbname.
i checked the PDOErrors.txt:
SQLSTATE[28000] [1045] Access denied for user 'username'@'11.22.33.61' (using password: YES)
^
why is it 11.22.33.61 and not 11.22.33.66 ? is that what is causing the error? or is there something else?
help. TIA