$array_of_id = is_array($_POST['id']) ? $_POST['id'] : [$_POST['id']];
$SQL = "UPDATE Users SET phone='$phone', name='$name', surname='$surname', second_name='$second_name', manager_comment='$manager_comment', delivery_adress='$delivery_adress', delivery_time='$delivery_time', delivery_date='$delivery_date', courier='$courier' WHERE id IN (" . implode(',', $array_of_id) .")";
function get_printed_users()
{
global $link;
if (isset($_POST['delivery_date'])) {
$form_date = $_POST['delivery_date'];
$SQL = "SELECT * FROM Users WHERE delivery_date='$form_date' AND delivery=1";
$result = mysqli_query($link, $SQL);
$users = mysqli_fetch_all($result, MYSQLI_ASSOC);
return $users;
} else {
$sql = "SELECT * FROM Users WHERE delivery = '1' ORDER BY id DESC LIMIT 25";
$result = mysqli_query($link, $sql);
$users = mysqli_fetch_all($result, MYSQLI_ASSOC);
return $users;
}
}
<?php
$post = get_printed_users();
?>
<?php foreach ($post as $users): ?>
<!-- table primary start -->
<div class="col-lg-12 mt-5">
<div class="col-md-6 mt-5">
<div class="card">
<div class="card-body">
<h4 class="header-title">Анкета №: <?=$users['id']?></h4>
<ul class="list-group">
<li class="list-group-item">Имя: <?=htmlspecialchars($users['name'], ENT_QUOTES)?></li>
<li class="list-group-item">Фамилия: <?=htmlspecialchars($users['surname'], ENT_QUOTES)?></li>
<li class="list-group-item">Отчество: <?=htmlspecialchars($users['second_name'], ENT_QUOTES)?></li>
и т.д.
string(47) "UPDATE Users SET delivery_status=2 WHERE id='0'"
Т.е. тогда он вообще не видит id