gpt4 book ai didi

php - 在循环中的 php mysql 记录插入期间日期 22 个月递增

转载 作者:行者123 更新时间:2023-11-30 23:09:42 24 4
gpt4 key购买 nike

<?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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com