Scroll to top

How to pass variable id through href in php

<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>

Leave a Reply

Your email address will not be published. Required fields are marked *