title: Select data from multiple tables in MySQL using check boxes and show the table field according to checkbox
body: <p>I have two tables in database of my users.</p>
  
  <p>First table contains user unique ID, Name, Contact No and other personal information.</p>
  
  <p>Second table contains unique id of user from first table and device information like his first machine number, second machine number and many others also.</p>
  
  <p>My table no 2 structure is..</p>
  
  <p><a href="https://i.stack.imgur.com/a6lMB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a6lMB.png" alt="table2"></a></p>
  
  <p>On the reports page, I am showing all the information in a table form using this</p>
  
  <pre><code>$sql = "SELECT e.* ,d.* FROM emitra_basic As e INNER JOIN emitra_device as d  ON d.uid=e.uid";
  $result = $conn-&gt;query($sql);
  
  if ($result-&gt;num_rows&gt;0) {?&gt;
              &lt;table &gt;&lt;tr&gt;&lt;td&gt; Uid&lt;/td&gt;&lt;td&gt; Name&lt;/td&gt;
               &lt;td&gt; Micro Atm&lt;/td&gt;.......and all column of both tables &lt;/tr&gt;                            
   &lt;?php while($row = $result-&gt;fetch_array()) {
     echo "&lt;td&gt;".  $row['uid']. "&lt;/td&gt;";
       echo "&lt;td&gt;".  wordwrap($row['name'],15,"\n",1). "&lt;/td&gt;"; ....and all  
      } echo "&lt;/table&gt;";  
  </code></pre>
  
  <p>It works fine. But I want to show a customised report. It means I want to give check box/radio button for user of tables field. If he select field uses check box then its show only those value which check box/radio button are selected. It likes if user select three check box/radio button like Uid, name, m_atm. It shows only details of three columns from both tables and display table view accordingly these columns.</p>