getError()方法不返回错误信息

浏览:12475 发布日期:2013/11/03 分类:求助交流
            $data['title']=I('post.title');
            $data['contents']=I('post.contents');
            $article=D('Article');
            $result=$article->add($data);
            if($result){
                $this->success('插入文章成功');
            }
            else
                $this->error($article->getError());
数据插入失败的时候,我无法通过getError()来确定错误出现在哪里,因为错误信息为空。最后发现是因为表前缀的问题导致插入失败,可是这是我手动查找的,这个getError()根本不起作用,不知道我哪里用的不对
最佳答案
评论( 相关
后面还有条评论,点击查看>>