title: PHP passing variable id through href
body: <p>I want to have a link to another page, with particular subject, How can I pass the id ?</p>
  
  <pre><code>&lt;table class="table table-hover"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Subject&lt;/th&gt;
              &lt;th&gt;Add Topic&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;?php foreach($subjects as $sub):?&gt;
              &lt;td&gt;&lt;?php echo $sub-&gt;subject;?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;a href='approve.php?id=".$sub-&gt;id."' role="button" class="btn"&gt;Add Topic&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;?php endforeach;?&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>