Home > Backend Development > PHP Tutorial > Yii 数据增添出错

Yii 数据增添出错

WBOY
Release: 2016-06-13 12:21:22
Original
1133 people have browsed it

Yii 数据添加出错
我用gii生成了Article模型
.....
public function actionInsert(){
        $articlr_mode=new Article();
        $articlr_mode->article_title=$_POST["title"];
        $articlr_mode->article_content=$_POST["content"];
        $articlr_mode->article_picture=$_POST["picname"];
        $articlr_mode->article_createtime=date('Y-m-d H:i:s',time());
        $articlr_mode->article_state=1;
        if($articlr_mode->save()){
            echo "Yes";
        }else{
            echo "No";
        }
       ......
  }
页面返回 "NO",没有其它错误提示,不知道错在哪.
在页面添加error_reporting(E_ALL);也没用
$_Post的里都有数据.
以下是我的数据库表



------解决思路----------------------
去yii官网看下数据库的操作

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template