In a FTS5 MATCH clause, column names used as filters are declared with an ending colon, like in:
... WHERE ftstable MATCH 'colname: keyword'
(as per https://sqlite.org/fts5.html#fts5_column_filters)
When I try to declare 'keyword' as a bound value, like in:
$sql = "SELECT * FROM ftstable WHERE ftstable MATCH 'colname: :keyword'";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(':keyword' => 'keyword'));
I get the following error:
SQLSTATE[HY000]: General error: 1 unrecognized token: ":"
because of the colon following the column name.
I get the same error using alternate syntax (? placeholders, bindValue(), etc.).
Does anyone know of a workaround here? Or am I missing something obvious? Many thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…