So why cant you provide them somewhere to input an option (or set group of options. ie 30min, 1hr, 3hr, 6hr, 12hr, 24hr etc) - then store that value in a table with a reference to the appointment and the user it applies to?
Something like:
id | appointment | user | reminder(hrs) | sent
1 | Joe's Bday | jack@test.com | 24 | 1
2 | Joe's Bday | mary@test.com | 12 | 0
Example of how you'd use it
$query = "Select * from remindertable;"
$query_results = mysqli_query($db, $query);
while($row = mysqli_fetch_row($query_results)) {
if($row[4] == 0) {
$query = "SELECT appt-time FROM <table w data> WHERE appt-name = '" .$row[1] ."' AND appt-user ='" .$row[2] ."'";
$timequery = mysqli_query($db, $query);
$timequery = mysqli_fetch_assoc($timequery);
$appt-time = date('Y-m-d H:I:S', strtotime($timequery['appt-time']));
$appt-time2 = new DateTime($appt-time);
//Get Current Time from Database
$query = "SELECT NOW()";
$currentQuery = mysqli_query($db, $query);
$currentQuery = mysqli_fetch_array($currentQuery);
$current-time = date('Y-m-d H:I:S', strtotime($currentQuery[0]));
$current-time2 = new DateTime($current-time);
$interval = $current-time2->diff($appt-time2);
//CHECK THE INTERVAL AGAINST THE VALUE FROM THE DATABASE AND UPDATE WHEN SENT
}
}
http://php.net/manual/en/class.datetime.php
http://php.net/manual/en/datetime.diff.php
http://php.net/manual/en/class.dateinterval.php