I have a table with lists like this, which is been populated from a php loop

```
| **name**   | **age**  | **course** | **action**      |

| wilson     | 56       | Web pro    | edit  delete    |

```

the edit button looks like 

```
 <a href="<?php echo base_url()?>admin/edit/{$row['id']}" data-href="#myModal">Edit</a>

```

I have a modal already which shows up when the edit is being clicked but I want a situation where when I click the edit button the url `localhost/admin/edit/3` where 3 is an id is run and a database query getting details of the user with id = 3 and is returned to the view which will now be populated into the modal.

I know this will probably be an ajax thing but I really don't know how to go about it.