Hi - this is a problem with your Apache / PHP / MySQL setup, not Zend
Framework.  You'll have to locate the error logs and read them for further
information.  Not sure about Windows, but this would typically be called
httpd-error.log in a Unix environment.

You might find more information on a forum specifically devoted to setting
up Apache PHP & Mysql on Windows.


Good luck!

Mark






olivia_dimaunahan wrote:
> 
> 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-tp23551405p23562644.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to