0

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

2
  • How many more times will you ask the same basic question? Did you look at any of the answers I and others have givin you? Commented Sep 1, 2010 at 18:32
  • I asked and you didn't answered correctly, I'm just trying to find a solution Commented Sep 1, 2010 at 18:40

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

It doesn't even call the addNews() method. If I wipe out the whole class, it still gives the error
I wraped it in the $db = new Admin_Model_News(); and it said No adapter found for Admin_Model_News how do I solve this?
DO you initialise Zend_Db in your bootstrap with config from application.ini?
I'm using resources.db.adapter = PDO_MYSQL I thought it did automatically
No it doesnt. I guess you fixed it. If not just search here you will find plenty of example of bootstraping your db resource.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.