You can differentiate the each edit button by using unique id
<button class='edit' data-id="<?php echo $_GET["id"];?>"> EDIT</button>. While click on the edit button, read the data-id by using the following code
$(document).on('click', '.edit', function(){ var id = $(this).attr('data-id'); //code - you need to do }) Better to show the data on next page, use bootstrap model box and AJAX request which will interact lot of the users.
$(document).on('click', '.edit', function(){ var id = $(this).attr('data-id'); if(id) { $.ajax({ url : your url("profile/edit/"+id) type : 'post', success: function(response){ if (response.success) { $('#modal').modal('show'); } } }): } });