I'm using PrestaShop 8.2.1 and I have a module that puts an insane amount of data in 2 tables and I manually truncate them with a simple script that I upload then delete every time I need it done and it works great. I don't want the script sitting in my files because they contain the DB , USER, and password in plain text.
I would like to streamline this and put it in my cronjobs for automation.
$sql = new mysqli ("localhost","Actual_DB", "actual_password", "Actual_USER"); mysqli_query($sql, "truncate wmbi_square_logs"); mysqli_query($sql, "truncate wmbi_square_task_item"); $sql->close();
Any hints or tips would be appreciated. Can I create it as a function every time I open the backend or as a cronjob script?
I am not interested in purchasing a module for this, BTW...