I have written a function which takes a database and a string and finds a match in the database and returns the corresponding values of book ISBNS..However it's not working for me....I think the problem is when I am matching the names....so for example I have Jack Thorne....When I pass it to the function am I supposed to put a comma in between since am getting the first name Jack from the first name column and the last name from the last name column....I have tried deliberately passing it a name of an author I know exists but it's not returning anything..Please help Here is the function
function booksByAuthor($db,$author){
$query='SELECT isbn FROM books_authors WHERE author_id = (SELECT author_id FROM authors WHERE first_name,last_name = :author)';
$statement = $db->prepare($query);
$statement->bindValue(':author', $author);
$statement->execute();
$isbns= $statement->fetchAll();
$statement->closeCursor();
return $isbns;
}
WHERE x,y=zis a meaningless statement. You meanWHERE x=z OR y=zpresumably.