Help

CDbException

CDbException

The table "article" for active record class "Article" cannot be found in the database.

/home/zikbay/public_html/yii-1.1.7.r3135/framework/db/ar/CActiveRecord.php(2237)

2225     private $_model;
2226 
2227     /**
2228      * Constructor.
2229      * @param CActiveRecord $model the model instance
2230      */
2231     public function __construct($model)
2232     {
2233         $this->_model=$model;
2234 
2235         $tableName=$model->tableName();
2236         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2237             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2238                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2239         if($table->primaryKey===null)
2240             $table->primaryKey=$model->primaryKey();
2241         $this->tableSchema=$table;
2242         $this->columns=$table->columns;
2243 
2244         foreach($table->columns as $name=>$column)
2245         {
2246             if(!$column->isPrimaryKey && $column->defaultValue!==null)
2247                 $this->attributeDefaults[$name]=$column->defaultValue;
2248         }
2249 

Stack Trace

#1
+
 /home/zikbay/public_html/protected/modules/Article/models/base/ArticleBase.php(28): CActiveRecord::model("Article")
23      * Returns the static model of the specified AR class.
24      * @return Article the static model class
25      */
26     public static function model($className='Article')
27     {
28         return parent::model($className);
29     }
30 
31     /**
32      * @return string the associated database table name
33      */
#2
+
 /home/zikbay/public_html/protected/views/site/faqs.php(16): ArticleBase::model()
11     <?php
12     Yii::import('Article.models.*');
13     $criteria = new CDbCriteria();
14     $criteria->compare('status',1);
15     $criteria->compare('category_id',settings::FAQ_CATEGORY);
16     $articles = Article::model()->findAll($criteria);
17     
18     echo '<div style="font-size:12px;">';
19     foreach ($articles as $article) {
20       echo '<p>'.CHtml::link($article->title,url('/site/faqs', array('alias' => $article->alias))).'</p>';
21       if ($this->get('alias','') == $article->alias)
#5
+
 /home/zikbay/public_html/protected/modules/Core/extensions/web/FController.php(101): CBaseController->renderFile("/home/zikbay/public_html/protected/views/site/faqs.php", null, true)
096     
097     public function renderFile($viewFile,$data=null,$return=false)
098     {
099         //Track the current view file so the InlineViewWidget knows which view it belong to
100         $this->CurrentViewFile = $viewFile;
101         return parent::renderFile($viewFile, $data, $return);
102     }    
103 
104     /**
105     * Get message of current page and also previous page
106     * 
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/zikbay/public_html/yii-1.1.7.r3135/framework/views/exception.php on line 217 2021-04-21 13:16:04 Apache/2.4.39 (Unix) OpenSSL/1.0.2k-fips Yii Framework/1.1.7