<table class="table table-hover">
<thead>
<tr>
<th>Subject</th>
<th>Add Topic</th>
</tr>
</thead>
<tbody>
<tr>
<?php foreach($subjects as $sub):?>
<td><?php echo $sub->subject;?></td>
<td><a href='approve.php?id=".$sub->id."' role="button" class="btn">Add Topic</a></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
How to pass variable id through href in php