I have a column in my table that will always contain an array of three items (they come from 3 selects with the same items that the user chooses from). I need to make a query that will return if any user has selected the same combination of 3 items that another user has selected too, doesn't matter the order he chose them in.
So I have 3 selects with the same content in them, the user needs to chose an item from each one (it's validated so all of them are different) and I need to check if that combination has been chosen before or not.
In my database the array looks like this:
a:4:{i:0;s:8:"item1";i:1;s:8:"item3";i:2;s:8:"item5"}
The database will have many users so I'm afraid that checking this will be very resource intensive, what is the best way to approach it?