Php/ MySql 'Advanced Search' Page

后端 未结 5 1933

I\'m working on an \'advanced search\' page on a site where you would enter a keyword such as \'I like apples\' and it can search the database using the following options:

5条回答
  •  余生分开走
    2021-02-04 15:47

    I would suggest the use of MySQL FullText Search using this with the Boolean Full-Text Searches functionality you should be able to get your desired result.

    Edit:

    Requested example based on your requested conditions ("Its just one field and they can pick either of the 4 options (i.e 1 word, exact words, at least 1 word, without the term).")

    I am assuming you are using php based on your initial post

    
    

    hope this helps for full use of the operators in boolean matches see Boolean Full-Text Searches

提交回复
热议问题