如果记录的状态在24小时后没有改变,需要向用户组发送短信和电子邮件吗?

I am using php and Mysql. I have a record in my database and i want to check status value of the record after 24hrs of its insertion if it is still in pending or no changed i want to send an SMS and an Email to some person relevant to the status. To achieve this i have implemented a solution in which i used a php code but it need to continuously execute and check status of record that may cause DoS. In Another solution i create a trigger but i can't able to send db values as parameter to the php file. so what should be its solution????

Two ways came into my mind for this.

First, (the good way) using cronjob. It's a really good way.

Second, (bad way for your purpose) Check to see which rows has age of 30 days in each request coming to website. There are cons for this way as the website doesn't get visitors for some days then SMS or Emails won't be sent on time. Another bad thing is it executes on every request so loading time and memory will be consumed during this process.

created a php file which contains a functionality of send sms and email. then create cronjob:

wget http://example.com/x.php

provide full address of your file.

while creating cronjob set time interval 24hrs