方法為什么會執(zhí)行兩次
public function query1() {
$bool = DB::table('student')->insert(
['name' => 'immoc', 'age' => 22 ]
);
file_put_contents(__DIR__.'/log.txt','111\\n',FILE_APPEND);//寫了兩條數(shù)據(jù)
$this->log($bool);
}
public function query1() {
$bool = DB::table('student')->insert(
['name' => 'immoc', 'age' => 22 ]
);
file_put_contents(__DIR__.'/log.txt','111\\n',FILE_APPEND);//寫了兩條數(shù)據(jù)
$this->log($bool);
}
2017-12-21
舉報
2019-07-31
我的也是這樣。我用的chrome瀏覽器就會插入兩條數(shù)據(jù)。試了一下用IE訪問就只插入一條數(shù)據(jù)。
我就想應(yīng)該是瀏覽器的問題,最大的可能就是插件的問題。結(jié)果是utorrent插件導(dǎo)致的。
估計還會有其他插件會有影響,一個一個刪除排查就好了。
2018-10-07
請問你解決 一次調(diào)用,插入了兩條數(shù)據(jù)的 問題了嗎
2017-12-25
你自己調(diào)用了兩次,第一次是在上面,第二次是$this->log($bool)