Sample Header Ad - 728x90

MySQL events with TRUNCATE and INSERT

1 vote
1 answer
1817 views
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
Asked by CroDexter (11 rep)
Nov 12, 2016, 11:27 PM
Last activity: Mar 2, 2025, 11:02 PM