0

I have a search string and I want parse and convert it into MySQL query. For example:

(tag:"marketing" || tag:seo) && "example@example.com" && test

to

SELECT 
   * 
FROM 
   `table` 
WHERE 
   (`tag` LIKE "%marketing%" OR `tag` LIKE "%seo%") AND 
   content LIKE "%example@example.com%" AND 
   content LIKE "%test%"

P.S. I've already found this and this, but these solutions are not for me. Maybe somebody knows popular one?

Community
  • 1
  • 1
NPreston
  • 103
  • 3
  • Including "this" type links can lead to problems; forums are littered with broken links that leave the original problem opaque. Can you flesh out what you have tried, esp with an examples? – Charlie Joynt Mar 27 '17 at 11:18
  • @CharlieJoynt [Package](https://github.com/gdbots/query-parser-php) works with errors: incorrect parse search string into subqueries – NPreston Mar 27 '17 at 12:20

0 Answers0