I wanted to send an automated email 24hrs before an ppointment is made, and here is the code i wrote but it is first checking the date so not working correctly, please help
$i=0;
while($i<=$num)
{
$row=mysql_fetch_assoc($select);
$ID=$row['ID'];
$d=$row['date'];
$date=date("Y-m-d");
$rem=$row['reminder'];
$email=$row['email'];
if(($rem=='no')&&($d==$date))
{
if($row['time']<='24:00:00')
{
$headers = "From: [email]johndoe@yahoo.com[/email]";
mail($email,"Appointment reminder","This is reminder for your appointment with John Doe",$headers);
mysql_query("update table set reminder='send' where ID=$ID");
}
}
$i++;
}