Perhaps this is a very basic question, but I couldn't find any appropriate answer after Googling, and I'm quite new to this. How can I parse the value from a PHP foreach loop into a url and make it a query string?
Sounds unclear? Let me explain.
So, here's my PHP code:
<?php foreach ($results as $data){ ?>
<tr>
<td><?php echo $data->emp_id; ?></td>
<td><?php echo $data->emp_name; ?></td>
<td><?php echo $data->emp_mobile_no; ?></td>
<td><a href="<?php echo base_url(); ?>index.php/admin_logins/employee3"><button id="button_edit">Edit</button></a></td>
<td><a href="<?php echo base_url(); ?>index.php/admin_logins/employee4"><button id="button_delete">Delete</button></a></td>
</tr>
<?php }?>
Now, what I want to do is something like this:
<td><a href="<?php echo base_url(); ?>index.php/admin_logins/employee3/value of $data->emp_id"><button id="button_edit">Edit</button></a></td>
And, similarly, this as well:
<td><a href="<?php echo base_url(); ?>index.php/admin_logins/employee4/value of $data->emp_id"><button id="button_delete">Delete</button></a></td>
Now, what's the proper way to do this?