When I try to execute a query like this:
$sql3 = "SELECT items, amount FROM todoORtobuy
WHERE items , amount = :items, :amount
ORDER BY id DESC LIMIT 40";
$kysely3 = $DBH->prepare($sql3);
$kysely3->execute($data3);
I get this error:
Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' amount = 'Et dolores et sunt quae officia aut voluptas asperiores optio id e...' at line 1 in /home2-1/n/noorja/public_html/AdvancedTodoList/TodoTobuy.php:37 Stack trace: #0 /home2-1/n/noorja/public_html/AdvancedTodoList/TodoTobuy.php(37): PDOStatement->execute(Array) #1 {main} thrown in /home2-1/n/noorja/public_html/AdvancedTodoList/TodoTobuy.php on line 37
How can I fix the syntax error?