sql 匹配 () 与无法识别



当我尝试此查询时

SELECT name, cost FROM items WHERE MATCH (name) AGAINST ('baby')

phpmyadmin给了我一个警告,上面写着:

Unrecognized keyword. (near "MATCH" at position 43)
Unexpected token. (near "(" at position 49)
Unexpected token. (near "name" at position 50)
Unexpected token. (near ")" at position 58)
Unrecognized keyword. (near "AGAINST" at position 60)
Unexpected token. (near "(" at position 68)
Unexpected token. (near "'baby'" at position 69)
Unexpected token. (near ")" at position 74)

它仍然显示正确的结果。当我尝试另一个查询时:

SELECT fisrt_name , country FROM people WHERE MATCH (first_name) AGAINST ('marr')

它只给我和错误而没有得到结果。我犯了什么错误吗?

编辑:我更新了phpmyadmin,但我得到的是新的错误消息,说

 Can't find FULLTEXT index matching the column list
ALTER TABLE people ADD FULLTEXT people_first_name(first_name);

请尝试此操作以在第 first_name 列上添加全文索引,然后重试查询。

相关内容

  • 没有找到相关文章