Q:

How to use bootstrap modal to edit data in CodeIgniter

I have used table where user click on edit button then modal popup with the same data on every other modal. I want to popup modal with the data on which user click to edit. 
Modal_edit.php
      Edit 
 <? php
 $this->db->where('User_ID', $id);
 $query= $this->db->get('tbl_admin');
 foreach ($query->result() as $row)
 {
  $user=$row->Username;
  $pwd=$row->Password;
  $name=$row->Full_Name;
 }
? >
<div class="modal fade" id="myModal4" role="dialog">
<div class="modal-dialog">

  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">&times;</button>
      <h4 class="modal-title">Edit Admin</h4>

    </div>
    <div class="modal-body">
      <form method="post" class="horizontal" action="<?php echo "admin/edit/".$id; ? >" id="myForm">
        <div class="form-group">
          <label for="name" class="control-label">Full Name:</label>
          <input type="text" name="fname" class="form-control" placeholder="Full Name" id="firstname" value="<?php echo $name; ? >">
        </div>
        <div class="form-group">
          <label for="name" class="control-label">Username:</label>
          <input type="text" name="username" class="form-control" id="username" placeholder="Username" value="<?php echo $user; ? >">
        </div>
        <div class="form-group">
          <label for="name" class="control-label">Password:</label>
          <input type="text" name="pwd" class="form-control" id="pwd" placeholder="Password" value="<?php echo $pwd; ? >">
        </div>

        <button type="submit" class="btn btn-primary">Submit</button>
      </form>

    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
  </div>

</div>

A:

bootstrap modal is popup on same page without refreshing the page, For edit you need to refresh your page to get an id of particular user. 
In that case you need to use ajax.  With the use of ajax you can get particular user's id in modal without refreshing the page.