The following function works just fine, except I cannot change the book_isbn
. I made separate variables for the initial ISBN(from the DB) - $initISBN
and the new ISBN(from the form) - $isbn
. PHP or SQL throw no error and the other fields can be modified(the function works).
function updateNote($initISBN, $title, $author, $isbn) {
try {
**$query = "UPDATE notes SET book_title=:title, book_author=:author, book_isbn=:isbn WHERE book_isbn=:initISBN";**
$stmt = $this->conn->prepare($query);
$stmt->execute(array(':initISBN'=>$initISBN, ':title'=>$title, ':author'=>$author, ':isbn'=>$isbn));
} catch (PDOException $e) {
die("ERROR: " . $e->getMessage());
}
}
Thanks for your time!