CDbException

The table "tb_prb" for active record class "TbPrb" cannot be found in the database.

/home/salaya/domains/obt-salaya.go.th/public_html/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

#2
+
 /home/salaya/domains/obt-salaya.go.th/public_html/protected/controllers/MainController.php(1336): CActiveRecord->__construct()
1331      
1332     function actionPrb() {
1333         $this->layout = 'main-home-sub';
1334         $this->pageTitle = 'พรบ.การอำนวยความสะดวก';
1335         
1336         $model = new tbPrb();
1337 
1338         $criteria = new CDbCriteria();
1339         $criteria->compare('status', 'Active');
1340         $criteria->order = 't.id desc';
1341 
#10
+
 /home/salaya/domains/obt-salaya.go.th/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
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 Yii::createWebApplication($config)->run();
2024-03-19 10:49:00 Apache/2 Yii Framework/1.1.14