thinkphp3.2在Controller里为什么select没有数据?
刚学thinkphp,请大家多多指教。
class IndexController extends Controller {
public function index(){
$Dao = M("Article");
$articles = $Dao->select(); //用select检索不出数据
//$articles=$Dao->query("select * from think_Article" ); //用query有数据
$this->assign('articles', $articles);
// 输出模板
$this->display();
}
}
在application里也设置'DB_PREFIX' => 'think_'了。
运行环境:ubuntu、mysql。
为什么用select检索不出数据呢?请大家指教。谢谢。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号