Insert query on page load, inserts twice?

The logic of your front controller is wrong.

The page where you are executing this query is called on every request made to your site, no matter whether it’s a proper request or a call to a non-existent resource.

You must change the logic of the front controller so it wouldn’t run the application for the invalid requests. Otherwise there will be not one but thousands false inserts when the site goes live.

Leave a Comment