I am writting remider service script it should remind the due amount before 3 days in a particular month once in a year.
My code is working fine for current month, but how to set reminder if current date is 2015-07-30 but the actual due date will be in next month after 3 days. i.e. 2015-08-03. How to count days?
my current code:
<?php
include("configPDO.php");
$timezone = "Asia/Kolkata";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
$curdate = strtotime(date("Y-m-d"));
$unixtime = strtotime("+3 days",$curdate);
$bday = date("d",$unixtime);
$bmonth = date("m",$unixtime);
$result=$dbh->prepare("SELECT * FROM members WHERE month(date)=$bmonth AND day(date)=$bday");
$result->execute();
while($row = $result->fetch(PDO::FETCH_ASSOC)){
echo $row['member']."</br>";
echo $row['mobileno']."</br>";
echo $row['amount'];
}
?>