Create a table
scriptRun
scriptName
lastRun
=========
lastRun should be a DATETIME column
When you run the script:
UPDATE scriptRun
SET lastRun=NOW()
WHERE scriptName='ScriptToRun'
BEFORE you run the script
SELECT count(*)
FROM scriptRun
WHERE scriptName='ScriptToRun'
AND lastRun< NOW()-INTERVAL 1 DAY
This will return a 0 or 1 depending on whether the script has been run in the interval stated.
or
NOW()-INTERVAL 14 HOUR
etc...