I know this is a basic question that I should know the answer to, but i have never had to even consider it before and I could not find anything through google.
I want to automatically select or leave unselected checkboxes based on information in the database.
for example
I have two pairs of checkboxes each with a mens shoes and a womens shoes option. The user is able to select if they want only mens shoes or only womens shoes or both and the check boxes will be checked accordingly. Then there is another set for jeans which offer the same options.
In the database I have a few columns
id | foreignKeyId | Shoes | Jeans
The id column is auto incremented, the foreignKeyId is populated with the relevant foreignKey, shoes and jeans have been populated with an ENUM '0', '1', '2', '3'
0 = no selection
1 = mens selected
2 = womens selected
3 = both selected
I have then pulled the data from the database but I cant work out how to apply the information. I am assuming that I need to redesign my database.
What would be the best way to store and apply this information?