我正在尝试对表中添加全文索引的列执行全文搜索,但我想使用pdo构造'?'而不是:some_term。它不起作用。这是我的代码片段。有什么想法吗?:
$stmt = $db->prepare("SELECT * FROM $table (MATCH ($column0) AGAINST ?) OR (MATCH ($column1) AGAINST ?) OR (MATCH ($column5) AGAINST ?) OR (MATCH ($column6) AGAINST ?) ORDER BY id DESC");
if($stmt->execute(array("$query", "$query", "$query", "$query"))){
while($data_fetch = $stmt->fetch(PDO::FETCH_ASSOC)) {some code...}
}
当我尝试使用此代码进行搜索时,它什么都不做。我不想使用bindParam,我想使用execute(array ...)