I have an action that reads from files, then inserts rows into a database table and after that redirects to a index of model (index.php?r=punch)
when I try to run the action by entering the url in the browser (index.php?r=punch/read-files), data is read from the files and inserted into db correctly, but the same action is running again which generates duplicates in the database. I have noticed that when I comment the below lines, which is disabling debug mode, my code works as expected inserting the rows just once. But I really need debug mode to work properly… any ideas?
//defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);
//defined(‘YII_ENV’) or define(‘YII_ENV’, ‘dev’);