I have a form with a date selection:
<form method="post" name="date" action="date.php" > <input class="form-control" type="date" name="delivery_date" value="<?=htmlspecialchars(date('Ym-d', strtotime($users['delivery_date'])), ENT_QUOTES)?>" id="example-date-input"> <button type="button" class="btn btn-primary btn-xs mb-3">Найти</button> </form>
I need to remove from the database all the records for the specified date, I try to do this:
<?php require_once('db.php'); if(isset($_POST['date'])) { $date = ($_POST['date']); $SQL = "SELECT * FROM Users WHERE delivery_date='$date' AND delivery='1' ORDER BY id DESC"; print_r ($_POST); $result = mysqli_query($link, $SQL); if ($result) { header('Location:print.php'); } else { printf("Ошибка: %s\n", mysqli_error($link)); } } ?>
Is the screen correct with the request? And how to correctly display the data? I am trying to display all records for the specified date.