Thinkphp 5.0 获取最后执行的SQL
时间:2021-07-01 10:21:17
帮助过:54人阅读
2 $q=
new Question();
3 $q->save([‘qcount‘=>
$qs->qcount+1],[‘id‘=>input(‘qid‘
)]);
4 ///////=========================================
5 var_dump((
new Question())->db()->getLastSql());
//=
6 ///=================================================
7 //die;
8 $stu =
new Student();
9 $res =
$stu->
save([
10 ‘qid‘ => input(‘qid‘),
11 ‘tid‘ => input(‘tid‘),
12 ‘lock‘ => 1
13 ],
[
14 ‘uname‘ => Session::get(‘uname‘
)
15 ]);
16 用的就是
(new Question())->db()->getLastSql();
执行操作的是哪个数据表, 就用哪个数据模型
Thinkphp 5.0 获取最后执行的SQL
标签:操作 var_dump ssi res nbsp san etl save 就是