Error Info: Array ( [0] => 42000 [1] => 1064 [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `year`=2015' at line 4 )
in /home/g/gorkniga18/giab-online.ru/public_html/vendor/yiisoft/yii2/db/Command.php at line 1302
$exceptionClass = '\yii\db\Exception'; foreach ($this->exceptionMap as $error => $class) { if (strpos($e->getMessage(), $error) !== false) { $exceptionClass = $class; } } $message = $e->getMessage() . "\nThe SQL being executed was: $rawSql"; $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null; return new $exceptionClass($message, $errorInfo, $e->getCode(), $e); } /** * Returns a value indicating whether a SQL statement is for read purpose. * @param string $sql the SQL statement * @return bool whether a SQL statement is for read purpose. */ public function isReadQuery($sql) {
} else { $this->pdoStatement->execute(); } break; } catch (\Exception $e) { $rawSql = $rawSql ?: $this->getRawSql(); $e = $this->db->getSchema()->convertException($e, $rawSql); if ($this->_retryHandler === null || !call_user_func($this->_retryHandler, $e, $attempt)) { throw $e; } } } }
$this->prepare(true); try { $profile and Yii::beginProfile($rawSql, 'yii\db\Command::query'); $this->internalExecute($rawSql); if ($method === '') { $result = new DataReader($this); } else { if ($fetchMode === null) { $fetchMode = $this->fetchMode;
* @return array|false the first row (in terms of an array) of the query result. False is returned if the query * results in nothing. * @throws Exception execution failed */ public function queryOne($fetchMode = null) { return $this->queryInternal('fetch', $fetchMode); } /** * Executes the SQL statement and returns the value of the first column in the first row of data. * This method is best used when only a single value is needed for a query. * @return string|int|null|false the value of the first column in the first row of the query result.
if($article) { $sql2 = "SELECT `al`.`id` AS `al_id`, `al`.`slug` AS `alslug`, `arch_id` FROM `giab_archives_lists` AS `al` LEFT JOIN `giab_archives` AS `a` ON `al`.`arch_id` = `a`.`id` WHERE `arch_number`=" . $article['num'] . " AND `year`=" . $article['year']; $article2 = Yii::$app->db->createCommand($sql2)->queryOne(); $newslug = $article2['alslug']; } else $newslug= '1'; } return [$newslug,$article2['al_id']];
AppAsset::register($this); if (\Yii::$app->language == 'ru' && in_array(Yii::$app->controller->id, ['articles']) === true): if ($slug = Yii::$app->request->get('slug')) { if ($slug != 'archives') { $newslug = \app\modules\catalog\models\CatalogArticles::getArchlistid($slug); $newlang = 'en'; $newlanglabel = 'Eng'; if ($newslug[0] === null) { $link = Html::a('<i class="icon-menu icon-globe align-middle" aria-hidden="true"></i> <span class="menulink align-middle">Eng</span>', array_merge( \Yii::$app->request->get(), [Yii::$app->controller->action->id, 'language' => 'en']
{ $_obInitialLevel_ = ob_get_level(); ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); try { require $_file_; return ob_get_clean(); } catch (\Exception $e) { while (ob_get_level() > $_obInitialLevel_) { if (!@ob_end_clean()) { ob_clean(); }
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
*/ public function run() { $params = $this->params; $params['content'] = ob_get_clean(); // render under the existing context echo $this->view->renderFile($this->viewFile, $params); } }
$calledClass = Yii::$container->getDefinitions()[$calledClass]['class']; } if (get_class($widget) === $calledClass) { /* @var $widget Widget */ if ($widget->beforeRun()) { $result = $widget->run(); $result = $widget->afterRun($result); echo $result; } return $widget; }
/** * Ends the rendering of content. */ public function endContent() { ContentDecorator::end(); } /** * Begins fragment caching. * * This method will display cached content if it is available.
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], ]) ?> <?= Alert::widget() ?> <?= $content ?> </div> <?php $this->endContent(); ?>
{ $_obInitialLevel_ = ob_get_level(); ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); try { require $_file_; return ob_get_clean(); } catch (\Exception $e) { while (ob_get_level() > $_obInitialLevel_) { if (!@ob_end_clean()) { ob_clean(); }
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @since 2.0.1 */ public function renderContent($content) { $layoutFile = $this->findLayoutFile($this->getView()); if ($layoutFile !== false) { return $this->getView()->renderFile($layoutFile, ['content' => $content], $this); } return $content; } /**
* @return string the rendering result. * @throws InvalidArgumentException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered * @return string the rendering result of the layout with the given static string as the `$content` variable.
WHERE i.item_id = ".$slug; // " AND i.st=1 $article = Yii::$app->db->createCommand($sql)->queryOne(); if($article): return $this->render('/catalogarticles/viewOfOldarticle',[ 'article' => $article ]); else: endif; endif; } else{
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../config/common.php'), require(__DIR__ . '/../config/common-local.php'), require(__DIR__ . '/../config/web.php'), require(__DIR__ . '/../config/web-local.php') ); (new yii\web\Application($config))->run();
$_GET = [ 'slug' => '11162', ]; $_SESSION = [ '__flash' => [], ];