Well, well, what I understood from your problem is that here you need to generate modal editing to edit users, I will publish a template for you to follow as a base, it's very simple using only php, bootstrap, html and mysql.
Within your list or table add an edit field and soon after inside your foreach add this code here that will basically grab the id of each user and send to their respective editing mode:
<td><a class="btn btn-primary btn-xs" data-toggle="modal" data-target="#myModal<?php echo $aqui['login_id']?>"><i class="fa fa-pencil"></i></a></td>
Immediately after doing this you will add the modal the following code will create a modal for each user of your application to be able to change the data, inside the foreach you will reorder the same foreach from your table or list, put in the end of the code but you know where to put the following example is a modal to edit password:
<?php foreach($suavariavel as $aqui){ ?>
<!-- Modal -->
<div id="myModal<?php echo $aqui['login_id']?>" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Troca de Senha</h4>
</div>
<div class="modal-body">
<form role="form" method="post" action="user/edicao.php">
<div class="form-group">
<input id="id" class="form-control" value=" <?php echo $log['login_id']; ?> " name="id" type="hidden">
</div>
<div class="col-sm-12">
<div class="form-group">
<div class="form-line">
<input type="password" class="form-control" required placeholder="Digite uma senha minimo 5 digitos" name="password">
</div>
</div>
</div>
<div class="modal-footer">
<button id="ALTERAR" class="btn btn-lg btn-warning btn-block " type="submit">ALTERAR</button>
</div>
</form>
</div>
</div>
</div>
</div>
<?php } ?>
After only receiving modal data via post:
<?php
include("banco/banco.php");
session_start();
// Aqui você se conecta ao banco
$id = $_POST['id'];
$password = md5($_POST['password']);
try{
$query = "UPDATE login set login_password=:password WHERE login_id = $id";
$stmt = $conexao_pdo->prepare($query);
$stmt->bindParam(':password', $password, PDO::PARAM_STR);
$stmt->execute();
echo "
<script type=\"text/javascript\">
alert(\"Usuario Alterado!\");
location.href='../usuarios.php';
</script>";
}catch(PDOExecption $e){
echo "
<script type=\"text/javascript\">
alert(\"Erro, Contate o TI!\");
location.href='../index.php';
</script>";
}
?>