CDbException

Bảng "product" dùng cho lớp active record "Product" không có trong database.

/home/dracohotelqk3/public_html/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/dracohotelqk3/public_html/protected/models/Product.php(33): CActiveRecord::model("Product")
28      * @return Product the static model class
29      */
30     public  $img_str;
31     public static function model($className=__CLASS__)
32     {
33         return parent::model($className);
34     }
35 
36     /**
37      * @return string the associated database table name
38      */
#2
+
 /home/dracohotelqk3/public_html/protected/controllers/SiteController.php(316): Product::model()
311             
312             $criteria = new CDbCriteria();
313             $criteria->condition = (($condition_str)?$condition_str:'');
314             $criteria->with = array('lang');
315             $criteria->order = 't.id DESC';
316             $count=Product::model()->count($criteria);
317             $pages=new CPagination($count);
318         
319             // results per page
320             $pages->pageSize=21;
321             $pages->applyLimit($criteria);
#10
+
 /home/dracohotelqk3/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-29 02:23:28 LiteSpeed Yii Framework/1.1.7