title: how to dynamically select checkboxes
body: <p>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.</p>
  
  <p>I want to automatically select or leave unselected checkboxes based on information in the database.</p>
  
  <p>for example</p>
  
  <p>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.</p>
  
  <p>In the database I have a few columns</p>
  
  <p>id | foreignKeyId | Shoes | Jeans</p>
  
  <p>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'</p>
  
  <p>0 = no selection</p>
  
  <p>1 = mens selected</p>
  
  <p>2 = womens selected</p>
  
  <p>3 = both selected</p>
  
  <p>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.</p>
  
  <p>What would be the best way to store and apply this information?</p>