I have an exploded search string, and I need to see if any or all parts of it match an entry in a mysql DB table.
If user searches for something like “pour house greensboro”, then “pour house” would match an entry in the table. But the search could also be “$1 beer pour house greensboro, or anything else like that, and in any order, so I need to put each part of the search string together and check to see if it matches what’s in the DB
so, if the parts of the exploded string are just numbers, then I need to check it like this:
0 + 1 + 2 + 3 + 4
0 + 1 + 2 + 3
0 + 1 + 2
0 + 1
0
1 + 2 + 3 + 4
1 + 2 + 3
1 + 2
1
2 + 3 + 4
2 + 3
2
3 + 4
3
4
there could be more or less than 5 parts of the string
is there any way to do this easily?
I figured out how to do this, didn’t think to update this until now…