I got a database with multiple fields and about 10000 entries. I only need to check for the appearance of 4 different strings in one field.
Example:
id--name--sex--color--size--weight--price--points--class--
1 pet m white 180 90 120 1000 low
2 bob m white 180 90 110 2000 high
3 foo m white 180 90 120 3000 low
4 boo m white 180 90 140 1000 low
5 bla m white 180 90 100 2000 medium
6 blu m white 180 90 120 5000 lala
Basically there are 3 classes, but sometimes I have a custom class. Now I want to search my whole DB for the appearance of low, high and medium. It might be that there is no entry for one or more of them. Also I need to check whether there is a custom (unknown) class. It's enough to know whether they appear, I don't need any more data.
All I came up with is just querying the field class and then searching with phps in_array(), but I guess that's just a waste of resources.
Can someone help me here please ? How do I query this clever without querying all the results?