thinkphp怎么输出数据库内容?

有q吗,不是很清楚$M怎么写?
2025-04-14 22:04:22
推荐回答(1个)
回答1:

控制器:

$result = $M->where($where)->select(); //读取数据库内容
$this->assign("result",$result); //输出变量到模板
dump($result);//打印当前变量内容

模板:

{$vo.id}