CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column '‘paper' in 'where clause'. The SQL statement executed was: SELECT `a`.`id` AS `t0_c0`, `a`.`version` AS `t0_c1`, `a`.`version_update` AS `t0_c2`, `a`.`year` AS `t0_c3`, `a`.`month` AS `t0_c4`, `a`.`day` AS `t0_c5`, `a`.`stick` AS `t0_c6`, `a`.`writer_id` AS `t0_c7`, `a`.`editor_id` AS `t0_c8`, `a`.`blocker_id` AS `t0_c9`, `a`.`created_at` AS `t0_c10`, `a`.`edited_at` AS `t0_c11`, `a`.`published_at` AS `t0_c12`, `a`.`appeared_at` AS `t0_c13`, `a`.`template_type` AS `t0_c14`, `a`.`title` AS `t0_c15`, `a`.`type` AS `t0_c16`, `a`.`subtype` AS `t0_c17`, `a`.`comment_status` AS `t0_c18`, `a`.`comment_count` AS `t0_c19`, `a`.`winner` AS `t0_c20`, `a`.`published` AS `t0_c21`, `writer`.`id` AS `t1_c0`, `writer`.`username` AS `t1_c1`, `writer`.`password` AS `t1_c2`, `writer`.`gender` AS `t1_c3`, `writer`.`firstname` AS `t1_c4`, `writer`.`lastname` AS `t1_c5`, `writer`.`email` AS `t1_c6`, `writer`.`avatar_url` AS `t1_c7`, `writer`.`birthday` AS `t1_c8`, `writer`.`state` AS `t1_c9`, `writer`.`country_id` AS `t1_c10`, `writer`.`user_role` AS `t1_c11`, `writer`.`interest_area` AS `t1_c12`, `writer`.`get_correspondence` AS `t1_c13`, `writer`.`slogan` AS `t1_c14`, `writer`.`self_introduction` AS `t1_c15`, `writer`.`firstname_is_public` AS `t1_c16`, `writer`.`lastname_is_public` AS `t1_c17`, `writer`.`email_is_public` AS `t1_c18`, `writer`.`birthyear_is_public` AS `t1_c19`, `writer`.`birthother_is_public` AS `t1_c20`, `writer`.`state_is_public` AS `t1_c21`, `writer`.`interest_area_is_public` AS `t1_c22`, `writer`.`avatar_is_public` AS `t1_c23`, `writer`.`created_at` AS `t1_c24`, `writer`.`updated_at` AS `t1_c25`, `writer`.`activekey` AS `t1_c26`, `writer`.`points` AS `t1_c27`, `writer`.`logged_in_at` AS `t1_c28`, `writer`.`prev_logged_in_at` AS `t1_c29`, `writer`.`comment` AS `t1_c30`, `writer`.`inbox_mail_subscription` AS `t1_c31`, `writer`.`email_confirmed` AS `t1_c32`, `writer`.`email_confirmation_key` AS `t1_c33`, `writer`.`facebook_id` AS `t1_c34`, `writer`.`google_id` AS `t1_c35`, `writer`.`twitter_id` AS `t1_c36`, `editor`.`id` AS `t2_c0`, `editor`.`username` AS `t2_c1`, `editor`.`password` AS `t2_c2`, `editor`.`gender` AS `t2_c3`, `editor`.`firstname` AS `t2_c4`, `editor`.`lastname` AS `t2_c5`, `editor`.`email` AS `t2_c6`, `editor`.`avatar_url` AS `t2_c7`, `editor`.`birthday` AS `t2_c8`, `editor`.`state` AS `t2_c9`, `editor`.`country_id` AS `t2_c10`, `editor`.`user_role` AS `t2_c11`, `editor`.`interest_area` AS `t2_c12`, `editor`.`get_correspondence` AS `t2_c13`, `editor`.`slogan` AS `t2_c14`, `editor`.`self_introduction` AS `t2_c15`, `editor`.`firstname_is_public` AS `t2_c16`, `editor`.`lastname_is_public` AS `t2_c17`, `editor`.`email_is_public` AS `t2_c18`, `editor`.`birthyear_is_public` AS `t2_c19`, `editor`.`birthother_is_public` AS `t2_c20`, `editor`.`state_is_public` AS `t2_c21`, `editor`.`interest_area_is_public` AS `t2_c22`, `editor`.`avatar_is_public` AS `t2_c23`, `editor`.`created_at` AS `t2_c24`, `editor`.`updated_at` AS `t2_c25`, `editor`.`activekey` AS `t2_c26`, `editor`.`points` AS `t2_c27`, `editor`.`logged_in_at` AS `t2_c28`, `editor`.`prev_logged_in_at` AS `t2_c29`, `editor`.`comment` AS `t2_c30`, `editor`.`inbox_mail_subscription` AS `t2_c31`, `editor`.`email_confirmed` AS `t2_c32`, `editor`.`email_confirmation_key` AS `t2_c33`, `editor`.`facebook_id` AS `t2_c34`, `editor`.`google_id` AS `t2_c35`, `editor`.`twitter_id` AS `t2_c36`, `cv`.`article_id` AS `t3_c0`, `cv`.`version` AS `t3_c1`, `cv`.`created_at` AS `t3_c2`, `cv`.`appeared_at` AS `t3_c3`, `cv`.`published_at` AS `t3_c4`, `cv`.`slug` AS `t3_c5`, `cv`.`template_data` AS `t3_c6`, `cv`.`content` AS `t3_c7`, `cv`.`excerpt` AS `t3_c8`, `cv`.`keywords` AS `t3_c9`, `cv`.`metatitle` AS `t3_c10`, `cv`.`metadescription` AS `t3_c11`, `cv`.`metaimage` AS `t3_c12`, `cv`.`status` AS `t3_c13`, `cv`.`img1` AS `t3_c14`, `cv`.`img2` AS `t3_c15`, `cv`.`caption1` AS `t3_c16`, `cv`.`caption2` AS `t3_c17`, `cv`.`comment_status` AS `t3_c18`, `cv`.`comment_count` AS `t3_c19`, `cv`.`guest_writer` AS `t3_c20`, `cv`.`bio` AS `t3_c21`, `cv`.`winner` AS `t3_c22` FROM `ap_article` `a` LEFT JOIN ap_article_version AS av ON a.id = av.article_id AND a.version = av.version LEFT OUTER JOIN `ap_user` `writer` ON (`a`.`writer_id`=`writer`.`id`) LEFT OUTER JOIN `ap_user` `editor` ON (`a`.`editor_id`=`editor`.`id`) LEFT OUTER JOIN `ap_article_version` `cv` ON (`cv`.`article_id`=`a`.`id`) AND (`cv`.`version`=`a`.`version`) WHERE (av.slug = ‘paper-train’-superb-traffic-management-game-app)

/srv/www/apppicker.com/htdocs/vendor/yiisoft/yii/framework/db/CDbCommand.php(543)

531         {
532             if($this->_connection->enableProfiling)
533                 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534 
535             $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536             $message=$e->getMessage();
537             Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538                 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539 
540             if(YII_DEBUG)
541                 $message.='. The SQL statement executed was: '.$this->getText().$par;
542 
543             throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544                 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545         }
546     }
547 
548     /**
549      * Builds a SQL SELECT statement from the given query specification.
550      * @param array $query the query specification in name-value pairs. The following
551      * query options are supported: {@link select}, {@link distinct}, {@link from},
552      * {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553      * {@link limit}, {@link offset} and {@link union}.
554      * @throws CDbException if "from" key is not present in given query parameter
555      * @return string the SQL statement

Stack Trace

#6
+
 /srv/www/apppicker.com/htdocs/protected/models/Article.php(432): CActiveRecord->find(CDbCriteria)
427          $criteria = new CDbCriteria;
428          $criteria->alias = 'a';
429          $criteria->join = "LEFT JOIN ap_article_version AS av ON a.id = av.article_id AND a.version = av.version";
430          $criteria->condition = "av.slug = " . $slug;
431 
432          if ($result = static::model()->with("writer", "editor", "cv")->find($criteria)) {
433              return $result;
434          }
435      }
436 
437      /**
#7
+
 /srv/www/apppicker.com/htdocs/protected/controllers/SiteController.php(29): Article::loadArticleBySlug("‘paper-train’-superb-traffic-management-game-app")
24         }
25     }
26 
27     public function actionRedirectslug($slug)
28     {
29         $post = Article::loadArticleBySlug($slug);
30 
31         if($post){
32             $link = ViewHelper::createArticleLink($post->id, $post->cv->slug, ViewHelper::getArticleTypeName($post->type));
33             header ('HTTP/1.1 301 Moved Permanently');
34             header ('Location: '.$link);
#17
+
 /srv/www/apppicker.com/htdocs/index.php(58): CApplication->run()
53 
54 if (!isset($app->params[Configuration::PREFIX_ELASTICA]) || $app->params[Configuration::PREFIX_ELASTICA] == null || $app->params[Configuration::PREFIX_ELASTICA] == '') {
55     $app->params->add(Configuration::PREFIX_ELASTICA, '1');
56 }
57 
58 $app->run();
2024-03-19 01:39:13 nginx/1.20.1 Yii Framework/1.1.16