I use a string for store the days of the week, something like this:
MTWTFSS. And if I search for MF (Monday and Friday) then the query must return all the strings that contain MF (for example: MWF, MTWTFS, MF, and so on).
I don’t know how to do this in SQL (MySQL).
use
LIKEwith%-wildcard between the single characters:note that this will only work if the characters are in correct order – searching for
FMinstead ofMFwon’t give you any result.you’ll also need to find a way to insert the
%s to your search-term, but taht shouldn’t be a big problem (sadly you havn’t said wich programming-language you’re using).if the characters can be in random order, you’ll have to built a query like: