title: Display content on the basis of filter value
body: <p>I have created simple page in php which fetch data from database and display on web page.</p>
  
  <p>index.php</p>
  
  <pre><code>&lt;?php
    include_once 'dbop.php';
    $objUser = new Users();
    $users = $objUser-&gt;get_users();
  ?&gt;
  &lt;!DOCTYPE html&gt;
    &lt;html lang="en"&gt;
     .
     .
     &lt;form action="index.php" method="POST"&gt;
        &lt;select name="role" id="role"&gt;
          &lt;option value="Admin"&gt;&lt;?php echo 'Admin' ?&gt;&lt;/option&gt;
          &lt;option value="SysAdmin"&gt;&lt;?php echo 'SysAdmin' ?&gt;&lt;/option&gt;
          &lt;option value="User"&gt;&lt;?php echo 'User' ?&gt;&lt;/option&gt;
        &lt;/select&gt;
        &lt;table&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Name&lt;/th&gt;
                  &lt;th&gt;Role&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;?php
              for($i = 0; $i &lt; sizeof($users); $i++) {
          ?&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;?php echo ($users[$i]["name"]); ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;?php echo ($users[$i]["role"]); ?&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php } ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/form&gt;
    .
    .
  &lt;/html&gt;
  </code></pre>
  
  <p>dbop.php</p>
  
  <pre><code>&lt;?php
   .
   .
   public function get_users() {
     $sql = "select name, role from users";
     $data = $this-&gt;dbObj-&gt;ExecuteQuery($sql);
     $data_all = array();
     if ($data != null &amp;&amp; mysqli_num_rows($data) &gt; 0) {
       while($fetch_data = mysqli_fetch_assoc($data)) {
         $arr = array();
         $arr["name] = $fetch_data['name'];
         $arr["role"] = $fetch_data['role'];
         $data_all[] = $arr;
       }
     }
     return $data_all;
   }
  ?&gt;
  </code></pre>
  
  <p>I want to display the user name and role from database on the basis of selected role (dropdownlist).
  like if Admin value selected from dropdownlist then only Admin records need to display on web page.</p>