> -----Original Message----- > From: Ian Warner [mailto:[EMAIL PROTECTED] > Sent: 27 February 2007 12:57 > To: fw-general@lists.zend.com > Subject: [fw-general] Zend DB Table > > Hi > > I wish to use this functionality, I assume this is similar to the > Data_Objects that PEAR provides > > However where do I place the newly created classes that extend: > > class RoundTable extends Zend_Db_Table {} > > Is there any way to override this location.
Ok I did it this way: $table = new Dataobjects_Config_User() - placed the class in the directory structure - library/Dataobjects/Config/User.php Within this file added: class Dataobjects_Config_User extends Zend_Db_Table { protected function _setup() { $this->_name = 'user'; $this->_primary = 'User'; parent::_setup(); } } So this works. However I am getting the following issue: Zend_Db_Table::setDefaultAdapter($db); $table = new Dataobjects_Config_User(); $rowset = $table->fetchAll(); // display them all foreach ($rowset as $row) { // $row is a Zend_Db_Table_Row object echo '--><p>' . htmlspecialchars($row->Host) . '</p>'; } This comes up with Fatal error: Uncaught exception 'Zend_Db_Table_Row_Exception' with message 'column 'Host' not in row' in Using - $row->host I get - Notice: Undefined index: Host in C:\AWebEnvironment\htdocs\ZendFramework-0.8.0\library\Zend\Db\Table\Row.php on line 95 [_data:protected] => Array ( [host] => localhost [user] => root [password] => [select_priv] => Y [insert_priv] => Y [update_priv] => Y [delete_priv] => Y [create_priv] => Y [drop_priv] => Y [reload_priv] => Y [shutdown_priv] => Y [process_priv] => Y [file_priv] => Y [grant_priv] => Y [references_priv] => Y [index_priv] => Y [alter_priv] => Y [show_db_priv] => Y [super_priv] => Y [create_tmp_table_priv] => Y [lock_tables_priv] => Y [execute_priv] => Y [repl_slave_priv] => Y [repl_client_priv] => Y [create_view_priv] => Y [show_view_priv] => Y [create_routine_priv] => Y [alter_routine_priv] => Y [create_user_priv] => Y [ssl_type] => [ssl_cipher] => [x509_issuer] => [x509_subject] => [max_questions] => 0 [max_updates] => 0 [max_connections] => 0 [max_user_connections] => 0 ) There is data in this table for the host field. Hope that's enough info Cheers Ian > > Lastly is there a simple way to change the DB within the set connection or > do I need to create a new factory call? > > Cheers > > Ian