<?php
if (isset($_GET['master'])) {
if (isset($_POST['masterselect'])) {
$idmaster=$_GET['master'];
$masterone =$_POST['masterselect'];
$query="UPDATE internetinstallation SET master='$masterone' WHERE id_internetinstallation='$idmaster'";
mysqli_query($db,$query) or die (mysqli_error($db));
}
}
$query="SELECT*FROM internetinstallation WHERE id_summon";
$result=mysqli_query($db,$query) or die (mysqli_error($db));
//преобразовываю результат из бд в нормальный массив
for ($data=[]; $row=mysqli_fetch_assoc($result); $data[]=$row);
?>
<table>
<tr>
<h3 style="font-size:30px;color:red">Установка интернета</h3>
<td style="text-align:center;">Телефон</td>
<td style="text-align:center;">Место проживания</td>
<td style="text-align:center;">Принять</td>
<td style="text-align:center;">Мастера</td>
</tr>
<?php foreach ($data as $internetinstallation) { ?>
<tr>
<td><?= $internetinstallation["phone"] ?></td>
<td><?= $internetinstallation["place_residence"] ?></td>
<td><a href="masterpanel.php?master=<?= $internetinstallation["id_internetinstallation"] ?>">Принять</a></td>
<td> <form method="POST" action="masterpanel.php"><select name="masterselect">
<option value="Мастер1">Мастер1</option>
<option value="Мастер2">Мастер2</option>
<option value="Мастер3">Мастер3</option>
</select><button type="submit">Отправить</button>
</form></td>
</tr>
<?php } ?>
</table>
</body>
</html>
action="masterpanel.php"
<input type="hidden" name="master" value="<?= $_GET['master'] ?>" />