How can php+mysql automatically insert a piece of data into the database at 0 o'clock every day?
仅有的幸福
仅有的幸福 2017-06-23 09:12:06
0
3
1376

Suppose my database has a table with two fields

What I want to achieve is to automatically insert a piece of data into the database at 24:00 every day
For example, it turns out that
id=1
pv=0

I want to automatically insert one at 0 o'clock every day
id=2
pv=0

In another day,

will automatically insert one
id=3
pv=0

In another day,

will automatically insert one
id=4
pv=0

....

Does anyone understand this?

仅有的幸福
仅有的幸福

reply all(3)
给我你的怀抱

Method 1: Use mysql event to create a scheduled task

Reference: https://blog.codefun.cn/blog/...

Method 2: Use the scheduled task that comes with the operating system to execute the php script regularly

Method 3: Use nodejs or java or others which all come with scheduled tasks

仅有的幸福

crontab

Peter_Zhu

linux scheduled task crontab

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template