For a class assignment we were to make a form in which a user can log in, update account, and logout. It all works expect the update account changes arent bein saved in my SQL database and I keep getting a database error in my PHP. The error says it’s in my bound values, but i’ve looked and looked and they all appear to match. Please help me find the error.
[php]
try {
$db = new PDO($dsn, $username, $password, $options);
$update = "Update CustomerInfo set FirstName = :FirstName, LastName = :LastName, Address = :Address, City = :City, State= :State, Zip = :Zip, Phone = :Phone, EMail = :EMail, Password = :Password Where CustomerID = :CustomerID;";
$SQL = $db->prepare($update);
$SQL->bindValue(':CustomerID', $CustomerID);
$SQL->bindValue(':FirstName', $FirstName);
$SQL->bindValue(':LastName', $LastName);
$SQL->bindValue(':Address', $Address);
$SQL->bindValue(':City', $City);
$SQL->bindValue(':State', $State);
$SQL->bindValue(':Zip', $Zip);
$SQL->bindValue(':Phone', $Phone);
$SQL->bindValue(':EMail', $Email);
$SQL->bindValue(':Password', $pword);
$SQL->execute();
} catch(PDOException $e) {
echo("I blew up!");
$errorMessage = $e-> getMessage();
echo("<p>Database error: $errorMessage</p>");
}[/php]