Witam,
mam bardzo dziwny błąd korzystając z klasy Zend_Db_Table, metody fetchAll()
Mam taki skrypt:
<?php
//index.php
Zend_Loader::loadClass( 'Zend_Db' );
Zend_Loader::loadClass( 'Zend_Db_Table' );
$dbParams = array (..................);
$dbAdapter = Zend_Db::factory( 'PDO_MYSQL', $dbParams );
Zend_Db_Table::setDefaultAdapter( $dbAdapter );
?>
<?php
//app/admin/models/FormsModel.php
class FormsModel extends Zend_Db_Table {
protected function _setup() {
$this->_name = 'forms';
$this->_primary = 'id';
parent::_setup();
}
}
?>
<?php
//app/admin/controllers/FormsControllers.php
class Admin_FormsController extends Zend_Controller_Action {
function __construct
(Zend_Controller_Request_Abstract
$request, Zend_Controller_Response_Abstract
$response, array $args = array()) { parent::__construct($request, $response, $args);
try{
Zend_Loader::loadClass( 'FormsModel' );
$db = new FormsModel();
$result = $db->fetchAll();
}
catch (Exception $e){
}
}
?>
Komunikat błędu jaki dostaje:
Fatal error: Class 'Zend_Db_Table_Row_Abstract' not found in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test\library\Zend\Db\Table\Row.php on line 37(oczywiście klasa ta jest tam zaimplementowana.)
Tabela 'forms' w bazie wraz z danymi również istnieje.
a przed tym komunikat wyświetla jakiś cały plik (oto jego fragment):
?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: *
http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Db * @subpackage Table * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) * @license
http://framework.zend.com/license/new-bsd New BSD License */ /** * Zend_Loader */ require_once 'Zend/Loader.php'; /** * @category Zend * @package Zend_Db * @subpackage Table * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) * @license
http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Table_Row_Abstract { /** * The data for each column in the row (column_name => value). * * @var array */ protected $_data = array(); /** * This is set to a copy of $_data when the data is fetched from * a database, specified as a new tuple in the constructor, or * when dirty data is posted to the database with save(). * @var array */ protected $_cleanData = array(); /** * Zend_Db_Table parent class or instance. * * @var Zend_Db_Table */ protected $_table = null; /** * Connected is true if we have a reference to a live * Zend_Db_Table_Abstract object. * This is false after the Rowset has been deserialized. * * @var boolean */ protected $_connected = true; /** * Name of the class of the Zend_Db_Table object. * * @var string */ protected $_tableClass = null; /** * Primary row key(s). * * @var array */ protected $_primary; /** * Constructor. * * Supported params for $config are:- * - table = class name or object of type Zend_Db_Table_Abstract * - data = values of columns in this row. * * ...........
etc.......................
Siedze nad tym dwie godziny i nie mogę dojść do rozwiązania.. gdyby ktos pomógł byłbym wdzięczny (IMG:
http://forum.php.pl/style_emoticons/default/smile.gif)
Ten post edytował ska 30.03.2007, 17:55:31