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

  • Home
  • SEARCH
  • 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 7962345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:18:38+00:00 2026-06-04T05:18:38+00:00

I’m learning the Zend frame work, while going trough a tutorial i ran in

  • 0

I’m learning the Zend frame work, while going trough a tutorial i ran in to a No adapter found for Application_Model_DbTable_Users error. I can’t seem to figure it out.
here are my classes

class Application_Model_Register
 {
private $_dbTable;
private $db;

public function __construct()
{
    $this->_dbTable = new Application_Model_DbTable_Users();

        $parameters =array(
                        'host'     => '127.0.0.1',
                        'username' => 'root',
                        'password' => '******',
                        'dbname'   => 'tutblog',
                                                'adapter'  => 'Pdo_Mysql'
                   );
            try {
                $db = Zend_Db::factory('Pdo_Mysql', $parameters);
                $db->getConnection();
                } catch (Zend_Db_Adapter_Exception $e) {

                } catch (Zend_Exception $e) 
 }
 public function createUser($array)
{   var_dump($array);
    $_dbTable = new Application_Model_DbTable_Users();
    $this->_dbTable->insert($array);
    //insert('array') SQL commands-> form zen_db_table_abstract
}

DBtable Users’s class

class Application_Model_DbTable_Users extends Zend_Db_Table_Abstract
{

    protected $_name = 'users';
protected $_primary ='id';
protected $_password= 'password';
}

Other Users class is empty.

IndexController

public function indexAction()
{   
    $register =  new Application_Model_Register();
$register ->createUser(array( 'name' => 'becky',
                      'age'  => 25,
              'password' => 'somepw'
                 )2);*/
}

My ini file

[production]
phpSettings.display_startup_errors = 2
phpSettings.display_errors = 2
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"

resources.db.params.adapter_ = "PDO_MYSQL"
resources.db.params.host ='localhost'
resources.db.params.dbname ='tutblog'
resources.db.params.username = "root"
resources.db.params.password = "password"
resources.db.isDefaultTableAdapter = true



[staging : production]


phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

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

resources.db.params.adapter_ = "PDO_MYSQL"
resources.db.params.host ='localhost'
resources.db.params.dbname ='tutblog'
resources.db.params.username = "root"
resources.db.params.password = "password"
resources.db.isDefaultTableAdapter = true

`Thank you guys in advance, i really don’t know where to start new to the framework. I googled tried every thing, about to just restart the tut, but i feel like ill run in to this problem again.

thnx

Message: No adapter found for Application_Model_DbTable_Users

Stack trace:

ERROR CODE here

0 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Db/Table/Abstract.php(739): Zend_Db_Table_Abstract->_setupDatabaseAdapter()
#1 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Db/Table/Abstract.php(268): Zend_Db_Table_Abstract->_setup()
#2 /Applications/XAMPP/xamppfiles/htdocs/webs/zfNewTry/application/models/Register.php(10): Zend_Db_Table_Abstract->__construct()
#3 /Applications/XAMPP/xamppfiles/htdocs/webs/zfNewTry/application/controllers/IndexController.php(15): Application_Model_Register->__construct()
#4 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Action.php(513): IndexController->indexAction()
#5 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('indexAction')
#6 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#7 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#8 /Applications/XAMPP/xamppfiles/lib/php/pear/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#9 /Applications/XAMPP/xamppfiles/htdocs/webs/zfNewTry/public/index.php(26): Zend_Application->run()
#10 {main}  
Request Parameters:

array (
  'controller' => 'index',
  'action' => 'index',
  'module' => 'default',
)  
zf enable layout to get this template
  • 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-06-04T05:18:39+00:00Added an answer on June 4, 2026 at 5:18 am

    if I remember correctly, you need to tell your application to always use the db connection as default connection for the Zend_Db_Table classes.

    try putting this line after your db initialization:
    Zend_Db_Table::setDefaultAdapter($db)

    I think you should do this before you instantiate the Zend_Db_Table class, so change your Application_Model_Register::__construct() to:

    public function __construct()
    {
        $parameters =array(
                        'host'     => '127.0.0.1',
                        'username' => 'root',
                        'password' => '******',
                        'dbname'   => 'tutblog',
                                                'adapter'  => 'Pdo_Mysql'
                   );
         try {
             $db = Zend_Db::factory('Pdo_Mysql', $parameters);
             $db->getConnection();
         } catch (Zend_Db_Adapter_Exception $e) {
    
         } catch (Zend_Exception $e) { 
         }
         Zend_Db_Table::setDefaultAdapter($db);
         $this->_dbTable = new Application_Model_DbTable_Users();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
I want to construct a data frame in an Rcpp function, but when I
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.