sql 匹配 () 反对无法识别
sql Match () Against unrecognized
当我尝试这个查询时
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 上添加全文索引,然后重试您的查询。
当我尝试这个查询时
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 上添加全文索引,然后重试您的查询。