0
点赞
收藏
分享

微信扫一扫

TP5.1 getLastSql输出查询的SQL语句


TP5.1 getLastSql输出查询的SQL语句_软件测试

echo Db::name('live_course')->getLastSql();

例子:

                    $rs_ccid=Db::name('live_course')
->field('id')
->where(['pid'=>$id,'level'=>2])
->where('starttime >= '.time().' and (starttime<'.time().' or endtime>'.time().')')
->order('starttime', 'asc')
->limit(1)
->select();
$ccid = $rs_ccid['id'];
echo Db::name('live_course')->getLastSql();

SQL调试:官方文档:​​https://www.kancloud.cn/manual/thinkphp5_1/354098​​

 

把打印出来的SQL语句用navicat软件测试

 

TP5.1 getLastSql输出查询的SQL语句_sql_02

 

 

举报

相关推荐

0 条评论