title: Compare two tables from MYSQL
body: <p>I have to compare two tables , then list all of them as check boxes, while matched values should be checked and non matching without checked</p>
  
  <p><strong>//table 1</strong>  </p>
  
  <pre><code>rid| role_name  
  1  |    school  
  2  |    college  
  3  |  University  
  </code></pre>
  
  <p><strong>//table2</strong>  </p>
  
  <pre><code>id|rid | category  
  1 | 1  |  uniform  
  2 | 2  |  uniform
  </code></pre>
  
  <p>match rid from both table where category = 'uniform'
  list all and checked the matching rid</p>