0
Hello, I am using Mysql database and have an event that runs daily at 1 hour. Within this event I check the date present in a row and compare with the current date, if the current date is lower then I do the necessary operations. The problem is that I need to send an email indicating that this operation has taken place. It is possible to call a PHP function to perform this work from the Mysql event?
function daily_situation_update()
{
global $wpdb;
$mapping = get_option('socialdb_general_mapping_collection');
$collection_id = $mapping['Emprestimo'];
$event = "CREATE
EVENT IF NOT EXISTS
e_daily_situation_update
ON SCHEDULE
EVERY 1 DAY_HOUR
COMMENT 'Altera o Status dos livros'
DO
BEGIN
SET SQL_SAFE_UPDATES = 0;
UPDATE
$wpdb->term_relationships
SET
term_taxonomy_id = ...
How are you performing this daily task? Cron?
– Woss
I created an event in Mysql to perform this task, created the event from PHP
– Andre Alvim
So please [Edit] the question and add these codes. If you already have PHP involved in this process, it should not be difficult to make it send the email.
– Woss