开发者

Problem with Zend_Db_Abstract in Model

开发者 https://www.devze.com 2023-01-14 23:29 出处:网络
I\'ve found out that when I extends Zend_Db_Table_Abstract in my model I get An Error Ocurred Aplication error

I've found out that when I extends Zend_Db_Table_Abstract in my model I get

An Error Ocurred

Aplication error

When I run this code

<?php

class Admin_Model_News
{
    protected $_name = 'news';
    protected $_primary = 'new_id';

    public function addNews($data) {
        $this->insert($data);
    }
}

It works properly, but when I run

<?php

class Admin_Model_News extends Zend_Db_Table_Abstract
{
    protected $_name = 'news';
    protected $_primary = 'new_id';

    public function addNews($data) {
        $this->insert($data);
    }
}

It messes up What could be wrong? You can check开发者_运维技巧 some of my files here


Wrap the insert in a try catch block:

try{
    $this->insert($data);
} catch (Exception $e){
    echo $e->__toString();
}

This will give you a more detailed error message then application error. AND PLEASE comment here if it doesnt work dont post a new question AGAIN.

0

精彩评论

暂无评论...
验证码 换一张
取 消