CDbException

CDbCommand nie zdołał wykonać instrukcji SQL: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'post' in 'where clause'. The SQL statement executed was: SELECT *
FROM `post`
WHERE (type=post) AND (status=2)
ORDER BY `update_time` DESC LIMIT 6 OFFSET 3

/var/www/vhosts/radiotp.pl/httpdocs/yii/framework2/db/CDbCommand.php(528)

516             return $result;
517         }
518         catch(Exception $e)
519         {
520             if($this->_connection->enableProfiling)
521                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
522             $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
523             $message = $e->getMessage();
524             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
525                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
526             if(YII_DEBUG)
527                 $message .= '. The SQL statement executed was: '.$this->getText().$par;
528             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
529                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
530         }
531     }
532 
533     /**
534      * Builds a SQL SELECT statement from the given query specification.
535      * @param array $query the query specification in name-value pairs. The following
536      * query options are supported: {@link select}, {@link distinct}, {@link from},
537      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
538      * {@link limit}, {@link offset} and {@link union}.
539      * @return string the SQL statement
540      * @since 1.1.6

Stack Trace

#1
+
 /var/www/vhosts/radiotp.pl/httpdocs/themes/RadioTP/views/post/show.php(21): CDbCommand->queryAll()
16                     ->from('post')
17                     ->where(array('and', 'type='.$_GET['type'], 'status=2'))
18                     ->order('update_time DESC')
19                     ->limit('6')
20                     ->offset('3')
21                     ->queryAll();
22                 foreach($images as $row) {
23                 echo "<div class='archive'>".CHtml::link(CHtml::encode("#   ".$row['title']), 'post/view?id='.$row['id'])."</div>";
24                 }
25             ?>
26             </div><br />
#5
+
 /var/www/vhosts/radiotp.pl/httpdocs/protected/controllers/PostController.php(84): CController->renderPartial("show", array("dataProvider" => CActiveDataProvider))
79             'dataProvider'=>$dataProvider,
80             ));
81         }else{
82             $this->renderPartial('show',array(
83                 'dataProvider'=>$dataProvider,
84             ));
85         }
86 
87         
88     }
89      
#10
+
 /var/www/vhosts/radiotp.pl/httpdocs/protected/modules/rights/components/RController.php(36): CFilter->filter(CFilterChain)
31     */
32     public function filterRights($filterChain)
33     {
34         $filter = new RightsFilter;
35         $filter->allowedActions = $this->allowedActions();
36         $filter->filter($filterChain);
37     }
38 
39     /**
40     * @return string the actions that are always allowed separated by commas.
41     */
2024-03-28 12:13:32 Apache Yii Framework/1.1.9