<?php
$current_date=date("Y-m-d");
$vacation=mysql_query("SELECT * FROM `employee`
WHERE `employe_no`='$employe_no'");
$showvacation=mysql_fetch_array($vacation);
$date=$showvacation['joinng_date'];
$mod_date = strtotime($date."+ 22 months");
$due_date=date("Y-m-d",$mod_date);
?>
是否可以在自动插入新记录时添加 22 个月的日期? 基本上我在做一个人力资源网络应用程序,每 22 个月休假一次。
最佳答案
我从你的问题中了解到你想要这样的东西:
$customDate = date('Y-m-d', strtotime("+22 months", strtotime($customDate)));
或者您可能想要这样的东西:
only 3 users shoud be inserted into the database within a timespan of 5 months
关于php - 在循环中的 php mysql 记录插入期间日期 22 个月递增,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20375560/