dqjo4340 2013-11-14 08:30
浏览 51

PHP服务器基于时间的指令

Im a seasoned dev that just wants to know if PHP is capable of setting variables at certain times of the day. For instance, I have a video of the day widget which I can manage on my own by changing the WHERE id='$x', but I'd like $x to $x to be randomized like executing ORDER BY rand() LIMIT 1. The issue with ORDER BY rand() LIMIT is that it changes every page load when I'd just want the '$x' from WHERE id='$x' to be changed at midnight every day.

So does PHP allow time-based executions, or is that considered a cron job? Please note I have no idea im just guessing terms.

  • 写回答

3条回答 默认 最新

  • doubeng9407 2013-11-14 08:33
    关注

    PHP is server side script executed by client. If you want it to do specific actions outside normal browsing, you need to set ap a cron job.

    评论

报告相同问题?

悬赏问题

  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程