Can I create event that would first TRUNCATE
table and then make INSERT
?
I know how to TRUNCATE
and INSERT
in separate events but need to do it immediately one after the other. I just don't know the syntax for events.
I can do it in myPHPadmin
TRUNCATE tbl1;
INSERT INTO
tbl1
SELECT
....
I know I could you PHP to run those two queries. I prefer event.
Is it possible to do it in single event or at least to call those two event in other event.
BTW, are MySQL events ok to use or PHP file with cron
would be better?
Thank you
Best Answer
You can create:
In case when You do not want use MySQL bud scheduler, You always can call this stored procedure from PHP, cron, any other SQL script and etc