$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()根本不起作用,不知道我哪里用的不对 最佳答案