title: Row clicked changes content depending on sql
body: <p>I have a dashboard with many components, one of the components is a table. Once the dashboard is loaded only the table is seen, the user should click on one row to see the corresponding information and graphs. </p>
  
  <p>I'm doing this using php and mysql. Can someone help me with implementing this. </p>
  
  <p>I do not want the page to reload, it should be automatically, if the user clicks on a row, the corresponding data changes. </p>
  
  <pre><code>&lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
          &lt;th&gt;Name&lt;/th&gt;
          &lt;th&gt;Age&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;?php 
        $sql = "select * from file WHERE id ='".$id."'";
        $result = $conn-&gt;query($sql);
  
        if ($result-&gt;num_rows &gt; 0) {
            while($row = $result-&gt;fetch_assoc()) {
                echo "&lt;tr&gt;";
                echo "&lt;td&gt;".$row['name']."&lt;/td&gt;";
                echo "&lt;td&gt;".$row['age']."&lt;/td&gt;";
                echo "&lt;tr&gt;";
            }
        }
  
       ?&gt;
  
      &lt;/tbody&gt;                                
      &lt;/table&gt;
  </code></pre>