Answer the question
In order to leave comments, you need to log in
How to create a complex MySQL with an event correctly?
I'm trying to create a query to the database, save the data and set an event for the saved data in parallel.
Here is my request:
$this->db->query( "INSERT INTO " . PREFIX . "_users_balance
(name, payer, post_id, user_balance_hold) VALUES
('$user', '$payer', '$post_id', '$money')"
);
$this->db->query( "CREATE EVENT $event_name
ON SCHEDULE EVERY $bs_time HOUR
STARTS CURRENT_TIMESTAMP
ENDS CURRENT_TIMESTAMP + INTERVAL $bs_time HOUR
DO
INSERT INTO " . PREFIX . "_users_balance
(name, payer, post_id, user_balance_hold) VALUES
('$user', '$payer', '$post_id', '$money')"
);
Answer the question
In order to leave comments, you need to log in
Now the event is executed immediately when a request is made to the databaseDuc because
STARTS CURRENT_TIMESTAMP
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question