Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6127903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:33:57+00:00 2026-05-23T16:33:57+00:00

I have very strange error I can’t understand. I started a new project throw

  • 0

I have very strange error I can’t understand. I started a new project throw the zf.sh.
And now when I try to ge the data from the database I get error for every table I have created when I’m trying to get data from it.

In this case I try to get a user that exist in the database.

Error:

Message: No adapter found for App_Model_DbTable_User
Stack trace:
#0 /Applications/MAMP/htdocs/offert/library/Zend/Db/Table/Abstract.php(739): Zend_Db_Table_Abstract->_setupDatabaseAdapter()
#1 /Applications/MAMP/htdocs/offert/library/Zend/Db/Table/Abstract.php(268): Zend_Db_Table_Abstract->_setup()
#2 /Applications/MAMP/htdocs/offert/application/models/UserMapper.php(9): Zend_Db_Table_Abstract->__construct()
#3 /Applications/MAMP/htdocs/offert/application/models/UserMapper.php(20): App_Model_UserMapper->setDbTable('App_Model_DbTab...')
#4 /Applications/MAMP/htdocs/offert/application/models/UserMapper.php(69): App_Model_UserMapper->getDbTable()
#5 /Applications/MAMP/htdocs/offert/application/controllers/AuthController.php(23): App_Model_UserMapper->find(3)
#6 /Applications/MAMP/htdocs/offert/library/Zend/Controller/Action.php(513): AuthController->loginAction()
#7 /Applications/MAMP/htdocs/offert/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('loginAction')
#8 /Applications/MAMP/htdocs/offert/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 /Applications/MAMP/htdocs/offert/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#10 /Applications/MAMP/htdocs/offert/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#11 /Applications/MAMP/htdocs/offert/public/index.php(26): Zend_Application->run()
#12 {main}  
Request Parameters:
array (
  'controller' => 'auth',
  'action' => 'login',
  'module' => 'default',
)  

Application.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view[] =

appnamespace = "App"

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

resources.db.adapter = "MYSQLI"
resources.db.params.dbname = "offert"
resources.db.params.host = "127.0.0.1"
resources.db.params.port = "8889"
resources.db.params.username = "root"
resources.db.params.password = "root"
resources.db.isDefaultTableAdapter = true

Bootstrap.php

<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    // Init Autoload
    protected  function _initAutoload() {
        $autoloader = new Zend_Application_Module_Autoloader(array(
                'namespace' => 'App',
                'basePath' => dirname(__FILE__),
        ));

        $autoloader->addResourceType('acl', 'acl/', 'Acl');
        $autoloader->addResourceType('classes', 'classes', 'Class');

        return $autoloader;
    }

    // Plugin Controller
    protected function _initControllerPlugin() {
        $front = Zend_Controller_Front::getInstance();
        $front->registerPlugin(new App_Plugin_Controller());
    }

    // Doctype
    protected function _initDoctype() {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');
    }

    // Db
    protected function _initDb() {
        $resource = $this->getPluginResource('db');
        $db = $resource->getDbAdapter();
        $db->query('SET CHARACTER SET \'UTF8\'');
    }

}

User.php in models/DbTable

<?php

class App_Model_DbTable_User extends Zend_Db_Table_Abstract {
    protected $_name = "user";
    protected $_primary = 'userID';
}

UserMapper.php

<?php

class App_Model_UserMapper {

    protected $dbTable;

    public function setDbTable($dbTable) {
        if(is_string($dbTable)) {
            $dbTable = new $dbTable();
        }
        if(!$dbTable instanceof Zend_Db_Table_Abstract) {
            throw new Exception('Invalid table data gateway provided');
        }
        $this->dbTable = $dbTable;
        return $this;
    }

    public function getDbTable() {
        if(null == $this->dbTable) {
            $this->setDbTable('App_Model_DbTable_User');
        }
        return $this->dbTable;
    }

    /**
     * Find specified user
     * @param $id
     * @return App_Model_User
     */
    public function find($id) {

        $result = $this->getDbTable()->find($id);

        if(0 == count($result)) return;

        $row = $result->current();

        $user = new App_Model_User();
        $user->setUserID($row->userID)
            ->setFirstname($row->firstname)
            ->setLastname($row->lastname)
            ->setEmail($row->email)
            ->setPassword($row->password)
            ->setTelephone($row->telephone)
            ->setRole($row->role)
            ->setActive($row->active)
            ->setCreated($row->created)
            ->setLastLogin($row->lastLogin)
            ->setCompanyID($row->companyID);
        return $user;
    }

Someone who can help me out and see what’s wrong with the code?
Thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:33:57+00:00Added an answer on May 23, 2026 at 4:33 pm

    The problem is your not bootstrapping db resource. By creating a method in your Bootstrap called _initDb your telling the Bootstrap that your method will handle the db resource bootstrap. So, the Bootstrap never calls, $this->bootstrap('db').

    If you try to add, $this->bootstrap('db') inside your method with the name _initDb your going to get an exception Circular resource dependency detected.

    So, the solution should be:

    protected function _initMyDb() {
        $this->bootstrap('db');
        $resource = $this->getPluginResource('db');
        $db = $resource->getDbAdapter();
        $db->query('SET CHARACTER SET \'UTF8\'');
    }
    

    After bootstrap, you can start using Zend_Db_Table::getDefaultAdapter()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very strange problem, when I try to var_dump (or print_r )
I have a very strange issue that I'm hoping someone can help me with.
I have this very strange issue with my MVC 2 project. Often times, I'll
I have a very strange issue with facebook-connect within my PHP-Webapplication. From one day
We have very strange problem, one of our applications is continually querying server by
I have a very strange problem. Under some elusive circumstances I fail to apply
I have a very strange problem with the Delphi 2006 IDE. If the IDE
I have been noticing some very strange usage of O(1) in discussion of algorithms
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have a very simple WPF application in which I am using data binding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.