I am currently working on a script which has a big database so to decrease load i built a table which contain a data that is updated every minute(CRON PHP FILE).So it works just fine but i am having right now an issue. The code I am using:
$conn->query("TRUNCATE tempo");
$conn->query("INSERT INTO ....");
and the php file i get the data from the tempo table the problem right now is that when php runs every minute there is a short delay like 1 second between data delete and data insert so in this 1 second the table tempo is empty so every minute i have 1second in which the website just return 0 data (because of the delay). How can I solve this problem ?