title: Flag field in mysql database
body: <p>Let's say you have a table which stores articles, and each article can have properties, like:</p>
  
  <ul>
  <li>publish status: A = published, D = draft, P = pending etc</li>
  <li>comment status: C = comments closed, O = comments open</li>
  <li>type: A = article, P = page, G = gallery</li>
  <li>maybe other stuff</li>
  </ul>
  
  <p>Anyway I was wondering if it's possible to store all this info into a "flags" field, instead of creating multiple fields for each property.</p>
  
  <p>How can I do this in such a way that I can still query my table based on these properties, like <code>SELECT * FROM table WHERE (publish status is "published")</code>, or order them and stuff like that?</p>