How to send an email from MySQL based on table values?

161
November 26, 2017, at 5:19 PM

I am having a bit of a problem with MySQL. I'm sure its something obvious to do but I'm struggling with this part, and as yet to find anything on the web to assist me. Heres some back story on my project and what I'm trying to achieve next.

I have 5 Arduino's running on a dedicated local network, which all use PHP functions to submit data (majority is temperatures) to MySQL every 30 seconds. This I have hosted on windows server 2012 R2 running xampp with apache and MySQL. Using this, I am hosting a wordpress site that retrieves the data from MySQL and displays it nicely with the most recent 10 entries and refreshes itself every 30 seconds. I can do this in tables and graphs and all values are there and everything runs smoothly.

For the next step I need a way of monitoring my data every 30 seconds and if the values the Arduino's send are above or below a certain temperature I need it to send me an alert to my email. I have G suite set up with my domain and I have all smtp settings ect just not sure how to read the tables values and action an email from there.

I thank you all in advance for your help

Details-- XAMPP V3.2.2 - Apache/2.4.29 (Win32) - OpenSSL/1.0.2l - PHP/7.1.11 - phpMyAdmin 4.7.4 -

READ ALSO
MySQL server won't start after reboot

MySQL server won't start after reboot

The title describes pretty much everythingI've checked multiple times but i can't find anything that would be using the same port and in the error log i get these 2 [error] lines:

342
Mysql function, return more than one row

Mysql function, return more than one row

I have build a little mysq function who should check is the users in my table are still vaid, the have got a row validfrom and validto and my function should check if the validto date is older than now

205
Dockerfile passing wrong mysql host ip address

Dockerfile passing wrong mysql host ip address

I created a build on my local machine and was working greatNow trying to do same in the server

217