thinkphp框架打印查询语句

直接上代码

 
$type_id = 31;
echo Db::name('ymtype')->where('parent_id', $type_id)->fetchSql()->select();  //打印查询语句
$results = Db::name('ymtype')->where('parent_id', $type_id)->select();
echo count($results);  // 显示结果数量,

posted @ 2024-04-20 00:11  79524795  阅读(21)  评论(0编辑  收藏  举报