title: How to storage checkbox values to a field of mysql for search?
body: <p>I want to storage checkbox valus to a field.</p>
  
  <h3>html like this</h3>
  
  <p><code>two value selected</code></p>
  
  <pre><code>&lt;input type="checkbox" value="1"&gt;invest_type1
  &lt;input type="checkbox" value="2" checked&gt;invest_type2
  &lt;input type="checkbox" value="3" checked&gt;invest_type3
  &lt;!-- more, but less than 20--&gt;
  </code></pre>
  
  <h3>mysql table dict</h3>
  
  <pre><code>id
  project_name
  invest_types   // how to save?
  // other fields
  </code></pre>
  
  <h3>Demand</h3>
  
  <p><code>multiple select</code></p>
  
  <p>exp. User select "invest1" and "invest2",then how to fetch that row?</p>
  
  <h3>Plans</h3>
  
  <ol>
  <li><p>use bit method to storage.</p>
  
  <p>invest_type2 is 2 , pow(2,2) => 4</p>
  
  <p>invest_type2 is 3 , pow(2,3) => 8</p>
  
  <p>4+8=12,when select use invest_types &amp; (invest_type1's pow + invest_type2's pow)</p></li>
  <li><p>add table to relate</p>
  
  <p>add table to storage invest_types with every project.</p>
  
  <p>use join and distinct when use search.</p></li>
  </ol>
  
  <h3>Problem &amp; Help</h3>
  
  <ul>
  <li>Which plan is the best?</li>
  <li>What about efficiency of plan1?</li>
  </ul>