Phalcon插入新数据

时间:2015-09-02 16:54:01

标签: php phalcon

我有以下代码:

控制器

class UploadController extends ControllerBase{

    public function indexAction() {

        if ($this->request->isPost()){

            query = new Data();
            query->text = "test";

            if ($query->save() == false) {
                echo "Umh, We can't store data right now: \n";
                foreach ($query->getMessages() as $message) {
                    echo $message, "\n";
                }
            } else {
                $id = $query->id;
            }
        }
    }
}

模型

use Phalcon\Mvc\Model;

class Data extends Model{

   public $id;

   public $text;

   public function getSource() {

       return 'data';
   }
}

在我的本地环境中,它正常工作,当我将其上传到AWS并调试代码查询时,hovewer-> text =" test&#34 ;;没有执行它在它之前打破。我查了那张桌子。你能帮我理解问题出在哪里吗?

0 个答案:

没有答案