Hi,

I'm a newbie in Zend Framework and have been testing tutorial examples.  Can
anyone try to figure out what could be wrong with my code or any of my
Apache/MySQL and PHP settings?  This line is causing the error: $result =
$DB->fetchAssoc($sql);  Please help me, I'm stucked on this for days...

I've successfully installed XAMPP and have updated my php.ini (which is
located in c:\xampp\apache\bin).

Here's my code, to help you out in your scrutiny...

<?php
require_once 'Zend/Db.php';
require_once 'Zend/Db/Adapter/Pdo/Mysql.php';
require_once 'Zend/Controller/Action.php';

class UserController extends Zend_Controller_Action
{
        public function listAction()
        {
                $params = array('host' =>'localhost',
                                                'username'      =>'root',
                                                'password'  =>'',
                                                'dbname'        =>'zend'
                                                );
                $DB = new Zend_Db_Adapter_Pdo_Mysql($params);
    
                $DB->setFetchMode(Zend_Db::FETCH_OBJ);
                
                $sql = "SELECT * FROM `user` ORDER BY user_name ASC";

                //the next line is causing the error which just shows 
                //an Apache HTTP Server error screen (attached)         
                $result = $DB->fetchAssoc($sql);

                $this->view->assign('title','Member List');
                $this->view->assign('description','Below, our members:');
                $this->view->assign('datas',$result);
        }

}

http://www.nabble.com/file/p23551405/apache%2Berror.pdf apache+error.pdf 

Many thanks to all of you!
-- 
View this message in context: 
http://www.nabble.com/fetchAssoc%28%24sql%29-error...--please-help%21-tp23551405p23551405.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to