ciao!
non so se sono io oggi, ma non riesco ad usare la clausola LIKE con le prepared statement e PDO.
questo l'ultimo tentivo:
Codice PHP:
public function getBytitle($title) {
$cmd = "SELECT
book_id id,
title title,
author_name author,
editor_name editor,
price price,
isbn isbn,
note note
FROM book
INNER JOIN author ON author.author_id = book.author_id
INNER JOIN editor ON editor.editor_id = book.editor_id
WHERE title LIKE :title";
$stmt = $this->conn->prepare($cmd);
$stmt->bindValue(':title', "%$title%");
$stmt->execute();
return $stmt;
}
in questo caso non ho errori.
però mi ritorna tutti i records.
qualche suggerimento??