Answer the question
In order to leave comments, you need to log in
How can I count the script run by cron?
Essence such, in a file there is a request to a DB.
I need to change the request condition every time this script is run through cron.
Example:
#1
SELECT * FROM table WHERE id < 101
#2
SELECT * FROM table WHERE id > 100 && id < 201
#3
SELECT * FROM table WHERE id > 200 && id < 301
#4
SELECT * FROM table WHERE id > 300 && id < 401
.....................................................................
Answer the question
In order to leave comments, you need to log in
The state must be preserved between script runs, which means external memory must be used. So there really are no alternatives.
You can also insert a subquery into the request and get an id that can be changed under some conditions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question