I'm having a hard time crafting a query MySQL to search for a name, so the person can type the first and last name and accept another name among them. For example:
Search: 'JOSÉ NUNES' or 'NUNES JOSÉ'
Result: JOSÉ SILVA NUNES
The way I search today is basically:
SELECT * FROM pessoas WHERE nome LIKE %pesquisa%
I read something about REGEXP, but I could not use it functionally and I did not want to be repeating several " AND WHERE nome LIKE...
" because I use PDO, so it complicates a little.