$sql = "SELECT * FROM entry WHERE CONCAT(title,description,area,price,conditions) LIKE '%77%' ORDER BY id DESC LIMIT ? , 5"; $stmtSearch = $pdo->prepare($sql); $stmtSearch->execute([$start]);
に対して
Fatal error: Uncaught exception 'PDOException' with message '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 ''0' , 5' at line 6' in C:\xampp\htdocs\development\test\property_list.php:43 Stack trace: #0 C:\xampp\htdocs\development\test\property_list.php(43): PDOStatement->execute(Array) #1 {main} thrown in C:\xampp\htdocs\development\test\property_list.php on line 43
のエラーがでていて解決できずです...
$stmtSearch = $pdo->prepare($sql);
$stmtSearch->bindValue(1, $start, PDO::PARAM_INT);
$stmtSearch->execute();
ならエラーなしです。
LIKE '%77%'の77もバインドさせたいんですがどうすればよいでしょうか?
回答2件
あなたの回答
tips
プレビュー