且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在页面加载时插入查询,插入两次?

更新时间:2023-02-05 19:03:42

你的前端控制器逻辑错误.

对您的网站发出的每个请求都会调用您执行此查询的页面,无论它是正确的请求还是对不存在的资源的调用.

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.