Issues

ZF-12301: how to connect to database

Issue Type: Bug Created: 2012-06-22T15:52:38.000+0000 Last Updated: 2012-06-22T16:08:55.000+0000 Status: Closed Fix version(s): Reporter: Sabarinathan Kalidass (sabarinathancs) Assignee: Ryan Mauger (bittarman) Tags: - Zend_Db

  • Zend_Db_Adapter_Mysqli
  • database

Related issues: Attachments:

Description

this my controller <?php

class IndexController extends Zend_Controller_Action { public $options; public function init() { /* Initialize action controller here */ $bootstrap = $this->getInvokeArg('bootstrap'); $options = $bootstrap->getOptions(); //echo "

<

pre>"; print_r($options['webhost']);

    $model=new Application_Model_User();
    $model->getdata();



}

public function indexAction()
{

}

}

this my model

fetchAll($sql)); } } this my application.ini [production] phpSettings.display\_startup\_errors = 1 phpSettings.display\_errors = 1 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 = 1 webhost = database.adapter = PDO\_MYSQL database.params.host = localhost database.params.username = root database.params.password = root database.params.dbname = zend resources.layout.layoutPath = APPLICATION\_PATH "/layouts/scripts/" [staging : production] [testing : 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 webhost = database.adapter = PDO\_MYSQL database.params.host = localhost database.params.username = root database.params.password = root database.params.dbname = zend this the error got while i run Fatal error: Uncaught exception 'Zend\_Controller\_Response\_Exception' with message 'Cannot send headers; headers already sent in /Applications/MAMP/htdocs/zend/application/controllers/IndexController.php, line 12' in /Applications/MAMP/htdocs/zend/library/Zend/Controller/Response/Abstract.php:323 Stack trace: #0 /Applications/MAMP/htdocs/zend/library/Zend/Controller/Response/Abstract.php(341): Zend\_Controller\_Response\_Abstract->canSendHeaders(true) #1 /Applications/MAMP/htdocs/zend/library/Zend/Controller/Response/Abstract.php(768): Zend\_Controller\_Response\_Abstract->sendHeaders() #2 /Applications/MAMP/htdocs/zend/library/Zend/Controller/Front.php(992): Zend\_Controller\_Response\_Abstract->sendResponse() #3 /Applications/MAMP/htdocs/zend/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend\_Controller\_Front->dispatch() #4 /Applications/MAMP/htdocs/zend/library/Zend/Application.php(366): Zend\_Application\_Bootstrap\_Bootstrap->run() #5 /Applications/MAMP/htdocs/zend/public/index.php(25): Zend\_Application->run() #6 {main} in /Applications/MAMP/htdocs/zend/library/Zend/Controller/Response/Abstract.php on line 323 please any try to help me. i ma new to zend framework sp please help me thank you. ### Comments Posted by Ryan Mauger (bittarman) on 2012-06-22T16:08:55.000+0000 I'm closing this ticket as it is a support request, and not an issue with the framework. Please use the mailing list, or #zftalk on freenode irc for support. For getting started with Zend Framework with mysql, try Akrabat's tutorial at

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts