Help to implement the function of editing data through a modal window in this table. Tell me in what way it is necessary to transfer the id for editing the database from the modal window to the code with the script on UPDATE
<script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script> <script src='//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <table class="table table-list-search"> <div class="col col-xs-6"> <h3 class="panel-title">Студенты</h3> </div> <div class="col col-xs-6 text-right"> </div> <thead> <tr> <th>Имя</th> <th>Фамилия</th> <th>Отчество</th> <th class="text-right">Действие</th> </tr> </thead> <tbody> <?php while($row1 = mysqli_fetch_array($result)):;?> <tr> <td><?php echo $row1[1];?></td> <td><?php echo $row1[2];?></td> <td><?php echo $row1[3];?></td> <!--- Редактировать ---> <td class="text-right"> <form method="post" action="delete.php"> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#product_view"><i class="glyphicon glyphicon-pencil"></i></button> <!--- Удалить ---> <form method="post" action="delete.php"> <button type= "submit" class='btn btn-danger' name="delete" value="<?=$row1['0']; ?>" > <span class="glyphicon glyphicon-remove"></button></span></form> </td> </tr> <?php endwhile;?> </tbody> </table> <!-- Меню редактирования --> <div class="modal fade product_view" id="product_view"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <a href="#" data-dismiss="modal" class="class pull-right"><span class="glyphicon glyphicon-remove"></span></a> <h3 class="modal-title">Редактирование данных о студентах</h3> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12 product_content"> <form action= "#" method= "POST"> <div class="form-group"> <h2 class="heading">Ф.И.О.</h2> <div class="controls"> <input type="text" id="name" class="floatLabel" name="name"> <label for="name">Имя</label> </div> <div class="controls"> <input type="text" id="famil" class="floatLabel" name="famil"> <label for="famil">Фамилия</label> </div> <div class="controls"> <input type="text" id="otchest" class="floatLabel" name="otchest"> <label for="otchest">Отчество</label> <div class="space-ten"></div> <div class="btn-ground"></div> <button type="submit" class="btn btn-primary" name="edit" value="<?=$row['0']; ?>" ><span class="glyphicon glyphicon-pencil"></span> Подтвердить</button> </div> </div> </form> </div> </div> </div> </div> </div> </div> <?php require_once 'connection.php'; $link = mysqli_connect($host, $user, $password, $database) or die("Ошибка " . mysqli_error($link)); $link->set_charset("utf8"); if (isset($_POST['edit'])){ $id = htmlentities(mysqli_real_escape_string($link, $_POST['id'])); $name = htmlentities(mysqli_real_escape_string($link, $_POST['name'])); $famil = htmlentities(mysqli_real_escape_string($link, $_POST['famil'])); $otchest = htmlentities(mysqli_real_escape_string($link, $_POST['otchest'])); $edit=$_POST['edit']; $query ="UPDATE vse SET name='$name', famil='$famil', otchest='$otchest' WHERE id='$edit'"; $result = mysqli_query($link, $query) or die("Ошибка " . mysqli_error($link)); if($result) { header('Location: '.'studenti.php'); } mysqli_close($link); } ?>