CDbException

The table "download" for active record class "Download" cannot be found in the database.

/home/site/wwwroot/yiiMain/framework/db/ar/CActiveRecord.php(2312)

2300     private $_model;
2301 
2302     /**
2303      * Constructor.
2304      * @param CActiveRecord $model the model instance
2305      */
2306     public function __construct($model)
2307     {
2308         $this->_model=$model;
2309 
2310         $tableName=$model->tableName();
2311         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2312             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2313                 array('{class}'=>get_class($model),'{table}'=>$tableName)));
2314         if($table->primaryKey===null)
2315         {
2316             $table->primaryKey=$model->primaryKey();
2317             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2318                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2319             else if(is_array($table->primaryKey))
2320             {
2321                 foreach($table->primaryKey as $name)
2322                 {
2323                     if(isset($table->columns[$name]))
2324                         $table->columns[$name]->isPrimaryKey=true;

Stack Trace

#1
+
 /home/site/wwwroot/protected/models/Download.php(22): CActiveRecord::model("Download")
17      * @param string $className active record class name.
18      * @return Download the static model class
19      */
20     public static function model($className=__CLASS__)
21     {
22         return parent::model($className);
23     }
24 
25     /**
26      * @return string the associated database table name
27      */
#2
+
 /home/site/wwwroot/protected/controllers/SiteController.php(394): Download::model()
389     }
390     // downlaods
391     public function actionDownload_index()
392     {
393         $this->layout='main2';
394         $down = Download::model()->findAll();
395         //$downid = Download::model()->findByPk();
396         $down_cat = DownloadCategory::model()->findAllBySql('SELECT DISTINCT d.Title,d.Download_ID,dd.ID FROM download_category d INNER JOIN download dd ON d.Download_ID=dd.ID ');
397         $this->render('downloads_index',array('down'=>$down,'down_cat'=>$down_cat));
398     }
399     public function actionDownloads($type)
#10
+
 /home/site/wwwroot/index.php(14): CApplication->run()
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 
14 Yii::createWebApplication($config)->run();
15 
16 
17 ?>
2024-03-28 13:05:57 Apache Yii Framework/1.1.12