【发布时间】:2022-01-25 15:56:59
【问题描述】:
我应该执行这个方法,
但我不知道如何在绑定中将 %research 值作为 LIKE 参数传递:
public function researchElements($research) {
$stmt = $this->db->prepare("SELECT * FROM product WHERE product_name LIKE "'%?%'"");
$stmt->bind_param('s', $research);
$stmt->execute();
$result = $stmt->get_result();
$result = $result->fetch_all(MYSQLI_ASSOC);
return $result;
}
【问题讨论】:
-
this 有帮助吗?