$query = $connect->prepare("SELECT users.firstname, users.lastname, users.id
FROM users INNER JOIN users_friends ON users.id=users_friends.uID
WHERE bID=:USER AND type =:type AND accepted = '1' AND (users.firstname LIKE '%:queryString%' OR users.lastname LIKE '%:queryString%')
LIMIT 10");
$query->bindValue(":queryString", $queryString);
$query->bindValue(":type", $type);
$query->bindValue(":USER", $USER);
$query->execute();
这就是我所拥有的。
当我尝试 bindValue 然后在准备好的语句( %:queryString% )中使用它时出现错误
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens'
我该如何解决这个问题?