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 6115389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:05:07+00:00 2026-05-23T15:05:07+00:00

Controller : <?php class AdminController extends Zend_Controller_Action { public function init() { error_reporting(E_ALL); }

  • 0

Controller :

<?php
class AdminController extends Zend_Controller_Action
{
    public function init()
    {
        error_reporting(E_ALL);
    }

    public function indexAction()
    {
        // blank //
    }

    public function registerAction()
    {
        // database configuration //
        $config = array(
            'host' => 'localhost',
            'username' => 'root',
            'password' => '',
            'dbname' => 'zendfirst'
        );
        $db = new Zend_Db_Adapter_Pdo_Mysql($config);

        // get request(get/post) //
        $request = $this->getRequest();     

        if($request->isPost('fsubmit')) {
            $insert_data = array(
                'first_name' => $request->first_name,
                'last_name' => $request->last_name
            );
            $db->insert('admin', $insert_data);
        }
    }
}

View :

<form method="post" action="">

    <div class="form_div">
        <label for="first_name">First Name</label>
        <input type="text" value="" name="first_name" id="first_name" />    
    </div>

    <div class="form_div">
        <label for="last_name">Last Name</label>
        <input type="text" value="" name="last_name" id="last_name" />
    </div>

    <div class="form_div">
        <input type="submit" value="Register" name="fsubmit" id="fsubmit" />
    </div>

</form>

<style>
.form_div {
    padding : 5px;
}
</style>

Settings “php.ini”

extension=php_pdo_mysql.dll

Database table :

admin_id  first_name  last_name
--------  ----------  ---------

throwing the error

An error occurred
Application error

What is the problem? Is there any “profiler” like CodeIgniter in Zend Framework?

  • 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-23T15:05:08+00:00Added an answer on May 23, 2026 at 3:05 pm

    You are treating the post values as an object. Try this:

        public function registerAction()
        {
            // database configuration //
            $config = array(
                'host' => 'localhost',
                'username' => 'root',
                'password' => '',
                'dbname' => 'zendfirst'
            );
            $db = new Zend_Db_Adapter_Pdo_Mysql($config);
    
            // get request(get/post) //
            $request = $this->getRequest();     
    
            if($request->isPost('fsubmit')) {
                $post_data = $request->getPost();
                $insert_data = array(
                    'first_name' => $post_data['first_name'],
                    'last_name' => $post_data['last_name']
                );
                $db->insert('admin', $insert_data);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my AdminBase.php <?php class AdminBase extends Controller{ public function __construct(){ parent::Controller(); $admin
<?php class PI_Controller_Plugin_AssetGrabber extends Zend_Controller_Plugin_Abstract { public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { /* The module
<?php class Email extends Controller { function Email() { parent::Controller(); $this->load->library('email'); } function index()
Controller: <?php class VideosController extends ForumAppController { /** * Controller Name * @access public
I have a a controller referral_medium_controller.php with the following content <?php class ReferralMediumsController extends
I use the following the jquery statements to call my php controller function, it
Fatal error: Class 'Controller' not found in <local_path>\system\application\controllers\welcome.php on line 3 <?php class Welcome
I'm studying this code: http://www.w3style.co.uk/a-lightweight-and-flexible-front-controller-for-php-5 In it the author uses a static function to
I am developing with CakePHP and this is my Page Controller: <?php class PagesController
Read the comments in the code for a description: <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap

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.