having problems using Zend_Db_Table_Abstract::createRow()

Posted by Gootik on Stack Overflow See other posts from Stack Overflow or by Gootik
Published on 2010-12-30T03:41:36Z Indexed on 2011/01/13 10:53 UTC
Read the original article Hit count: 119

Filed under:
|
|

Hey,

I have built a model that extends Zend_Db_Table_Abstract and I can't figure out why I can't use createRow(); here is my code:

class Model_User extends Zend_Db_Table_Abstract
{
   public function createUser()
   {
       $row = $this->createRow();
       $row->name = 'test';
       $row->save();
   }
}

and in a controller I use:

$userModel = new Model_User();
$userModel->createUser();

which when run displays an error

An error occurred

Application error

here is my setup in application.ini

resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = "pass"
resources.db.params.dbname = "app_db"
resources.db.isDefaultTableAdapter = true

I am sure that my user/pass/dbname is correct.

I would appreciate it if you point me in the right direction.

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework