mysql keyword search

前端 未结 2 1508
后悔当初
后悔当初 2020-12-15 01:48

I have a table with names of movies, and I want to be able to search for a movie in that table. But I want to be able to search for part of the title, and still return a res

2条回答
  •  情深已故
    2020-12-15 02:44

    Have a look at the full text search capabilities of MySQL. Once you set up a full text index, you can do queries like this one:

    SELECT * 
    FROM movies
    WHERE MATCH(title) AGAINST ('quantum solace' IN BOOLEAN MODE)
    

提交回复
热议问题