is a condominium payment system and it is required to show if the owners paid in the range of 1 to 5 of each month I have the following but it does not do anything to me, it remains blank and the table does have data
<?php
session_start();
require_once('../../conexion.php');
$hoy = getdate();
$begin = new DateTime( '2018-08-01' );
$end = new DateTime( '2018-08-05' );
$end = $end->modify( '+1 day' );
$interval = new DateInterval('P1D');
$daterange = new DatePeriod($begin, $interval ,$end);
$alerta="";
foreach($daterange as $date){
$fecha_dia= $date->format("Ymd");
$sql = "SELECT * FROM pago_p WHERE fechadeposito ='$fecha_dia'";
$res = mysqli_query($conexion,$sql);
while($resultado = mysqli_fetch_array($res)){
if(!empty($resultado["pago"])) {
$alerta="si";
}
}
if ($alerta=="si") {
//despues del ciclo imprimimos la alerta para que en cada ciclo no la repita
echo '<script> alert("No realizaste el pago en la fecha determinada"); </script>';
}
}
?>
The table is your entity called date of deposit and its type is date