CDbException

The table "popup" for active record class "Popup" cannot be found in the database.

/var/www/html/yii/framework/db/ar/CActiveRecord.php(2362)

2350 
2351     /**
2352      * Constructor.
2353      * @param CActiveRecord $model the model instance
2354      * @throws CDbException if specified table for active record class cannot be found in the database
2355      */
2356     public function __construct($model)
2357     {
2358         $this->_modelClassName=get_class($model);
2359 
2360         $tableName=$model->tableName();
2361         if(($table=$model->getDbConnection()->getSchema()->getTable($tableName))===null)
2362             throw new CDbException(Yii::t('yii','The table "{table}" for active record class "{class}" cannot be found in the database.',
2363                 array('{class}'=>$this->_modelClassName,'{table}'=>$tableName)));
2364         if($table->primaryKey===null)
2365         {
2366             $table->primaryKey=$model->primaryKey();
2367             if(is_string($table->primaryKey) && isset($table->columns[$table->primaryKey]))
2368                 $table->columns[$table->primaryKey]->isPrimaryKey=true;
2369             elseif(is_array($table->primaryKey))
2370             {
2371                 foreach($table->primaryKey as $name)
2372                 {
2373                     if(isset($table->columns[$name]))
2374                         $table->columns[$name]->isPrimaryKey=true;

Stack Trace

#3
+
 /var/www/html/protected/controllers/SiteController.php(45): CActiveRecord->findByPk("1")
40      */
41     public function actionIndex()
42     {
43         // renders the view file 'protected/views/site/index.php'
44         // using the default layout 'protected/views/layouts/main.php'
45         $popup = Popup::model()->findByPk('1');
46         $this->render('index', array('popup' => $popup));
47     }
48 
49     /**
50      * This is the action to handle external exceptions.
#12
+
 /var/www/html/index.php(19): CApplication->run()
14 defined('YII_DEBUG') or define('YII_DEBUG', true);
15 // specify how many levels of call stack should be shown in each log message
16 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
17 
18 require_once($yii);
19 Yii::createWebApplication($config)->run();
2017-09-10 22:32:55 Apache Yii Framework/1.1.15