PHP script for email notification when data posted into MySQL database

I’m newbie into coding and have looked into many examples on StackOverflow to build a dashboard and PHP script to post data when sent by a hardware device. I’m successful in posting the data from the hardware device into MySQL dashboard.

Now I’m here asking for help or suggestion on how to integrate a email notification when a data matching a condition was posted onto MySQL.

I’m using godaddy for the project. Below is the example of how the data is stored in dashboard.

Dashboard has the following variables posted :

MACADDRESS
DEVICESTATUS

I wanted to set a condition when the DEVICESTATUS is not equal to 1111111 send an email to notify us.

Any help or suggestions or recommendations would be highly appreciated.

In this case, you can simply use CRON Job to get your task done. CRON will check your database every second for the condition you set. If the condition match then rest of code (To send email) will execute. It’s so simple.

hopefully, this helps you.