简体   繁体   English

如何基于php表中的时间戳在24小时内自动运行php脚本

[英]How to run automatically php script very 24 hours based on timestamp from table in php

anyone can help me, i want run script very 24 hours based on timestamp from table in php 任何人都可以帮助我,我想基于php表中的时间戳,非常运行脚本24小时

Am making investment website. 我正在制作投资网站。 i want add interest rate add daily to user database, actually i want run that script every 24 hours, i used cronjob but its not working perfectly because some users maybe time different with approx 10 seconds or 2 seconds. 我想将利率每天添加到用户数据库中,实际上我想每24小时运行一次该脚本,我使用了cronjob,但它无法正常运行,因为某些用户的时间可能相差大约10秒或2秒。 in cronjob there is possible with every secon only have every minute option 在cronjob中,每一个secon都有每分钟的选择

$d_test2  + 86400 <= $timestamp

$d_test2 is timestamp from database $ d_test2是数据库的时间戳

$timestamp = time();

how can solve this is issue? 如何解决这个问题?

i want add daily interest rate based on user timestamp 我想根据用户时间戳添加每日利率

You will need something called cron jobs in PHP 您将需要使用PHP的cron作业

Try ging through this link 尝试浏览此链接

https://www.cloudways.com/blog/schedule-cron-jobs-in-php/ https://www.cloudways.com/blog/schedule-cron-jobs-in-php/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM