您好,欢迎访问一九零五行业门户网

thinkphp3.2在Controller里为何select没有数据

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检索不出数据呢?请大家指教。谢谢。
分享到: 更多
------解决办法--------------------
$dao = m(article);
$articles = $dao->select();    //用select检索不出数据
echo $dao->getlastsql();
其它类似信息

推荐信息