I want to send alerts by email when the user's appointment is 3 days from its due date. but I get this error.
Warning: mysqli_error () expects exactly 1 parameter, 0 given in /usr/home/anasdprueba.com/web/envioemail.php
supposedly the query is wrong, thanks in advance
$sql = "select agenda.*, usuario.email from agenda inner join usuario ON agenda.idusuario = usuario.idusuario".
"where fecha_fin = date_sub(curdate(), interval 3 day)";
$rpt = mysqli_query($cn,$sql)or die(mysqli_error());
$asunto = 'Hola Usuario';
$cuerpo = '
<html>
<head>
<title>Bienvenido Usuario</title>
</head>
<body>
<p>
<b>Buen dia estimado usuario
</b>.
</p>
</body>
</html> ';
$headers = 'MIME-Version: 1.0\r\n';
$headers .= 'Content-type: text/html; charset=iso-8859-1\r\n';
while ($des = mysqli_fetch_array($rpt)) {
$destinatario = $des['email'];
mail($destinatario,$asunto,$cuerpo,$headers);
}