0
点赞
收藏
分享

微信扫一扫

tp6中fetchSql的作用是啥呀?


fetchSql:作用:输出sql语句。优点:便于调试.

<?php
namespace app\index\controller;

use app\BaseController;
use think\facade\Db;
class Index extends BaseController
{
public function hello()
{
$res=Db::table('user')->field('id,title')->where('id','>',19)->fetchSql(true)->select();
halt($res);//fetchSql默认是flase就是说跟没写一样的,true就是输出一条查询语句
}
}

tp6中fetchSql的作用是啥呀?_sql



举报

相关推荐

tp6 RabbitMQ

安装tp6

tp6 开启session

tp6调试(trace)

TP6 简单登录

0 条评论