我有数据库中的日期和月份,存储在单独的变量中。但是,如果今天是第 7 号,而我减去一周,则该月将是 0 相同的情况。我想添加lo_date
到lockin_period_date
和减去 3 个月,因为我希望它提前 3 个月向我发送电子邮件。如何将数据库中的值设置为我想要的日期?请帮忙。
<?php
include"connect_mysql.php";
$reminder_dates = mysql_query("SELECT*FROM registration_form");
while($row = mysql_fetch_array($reminder_dates)){
$main_dob_day = $row['main_dob_day'];
$main_dob_month = $row['main_dob_month'];
$main_dob_year = $row['main_dob_year'];
$joint_dob_day = $row['joint_dob_day'];
$joint_dob_month = $row['joint_dob_month'];
$joint_dob_year = $row['joint_dob_year'];
$loan_lo_day = $row['loan_lo_day'];
$loan_lo_month = $row['loan_lo_month'];
$loan_lo_year = $row['loan_lo_year'];
$lockin_period_day = $row['lockin_period_day'];
$lockin_period_month = $row['lockin_period_month'];
$lockin_period_year = $row['lockin_period_year'];
$legal_fee_clawback_day = $row['legal_fee_clawback_day'];
$legal_fee_clawback_month = $row['legal_fee_clawback_month'];
$legal_fee_clawback_year = $row['legal_fee_clawback_year'];
date_default_timezone_set('UTC');
$m = date("n");
$d = date("j");
$y = date("Y");
$time = time();
$today = date('n-j-Y', $time);
//main applicant birthday - reminder 7days in advance
$main_day = $main_dob_day-7;
if($main_day == $d && $main_dob_month == $m){
echo "Mail Sent!";
}
//
}
?>