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 '' at line 1 )
in /var/www/html/gre/vendor/yiisoft/yii2/db/Command.php at line 828
$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, (int) $e->getCode(), $e); } /** * Returns a value indicating whether a SQL statement is for read purpose. * @param string $sql the SQL statement * @return boolean whether a SQL statement is for read purpose. */ public function isReadQuery($sql) {
$this->pdoStatement->closeCursor(); } Yii::endProfile($token, 'yii\db\Command::query'); } catch (\Exception $e) { Yii::endProfile($token, 'yii\db\Command::query'); throw $this->db->getSchema()->convertException($e, $rawSql); } if (isset($cache, $cacheKey, $info)) { $cache->set($cacheKey, [$result], $info[1], $info[2]); Yii::trace('Saved query result in cache', 'yii\db\Command::query'); }
* @return array|boolean 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|null|boolean the value of the first column in the first row of the query result.
} else { $reply[$k]['next'] = 0; } $reply[$k]['reply'] = Yii::$app->gossip->createCommand($sql . ' limit 0,8')->queryAll(); $reply[$k]['pagestr'] = ''; $total = $reply[$k]['count']? intval(ceil($reply[$k]['count']/8)):0; $reply[$k]['userImage'] = Yii::$app->db->createCommand("select image from x2_user where uid={$v['uid']} ")->queryOne()['image']; for($pagenum=0;$pagenum<$total;$pagenum++){ if ($pagenum == 0) { $reply[$k]['pagestr'] .= '<li class ="on"><a onclick="repleyPage(' . $reply[$k]['id'] . ',' . $id . ',1,' . intval($pagenum + 1) . ',this)">' . intval($pagenum + 1) . '</a></li>'; } else { $reply[$k]['pagestr'] .= '<li class =""><a onclick="repleyPage(' . $reply[$k]['id'] . ',' . $id . ',1,' . intval($pagenum + 1) . ',this)">' . intval($pagenum + 1) . '</a></li>'; }
$pageSize = Yii::$app->request->get('pageSize',10); $limit = " limit ".($page-1)*$pageSize.",$pageSize"; // $uid = $this->user->getuserinfo()['uid']; $uid = Yii::$app->session->get('uid',0); $data = Forum::getPostDetail($id, $uid,$limit); // var_dump( $data);die; $data['data']['content']= htmlspecialchars_decode( $data['data']['content']); $data['data']['content']= Forum::updaetContenttext( $data['data']['content']); $datauid = $data['data']['uid']?$data['data']['uid']:0; $data['data']['userImage'] = Yii::$app->db->createCommand("select image from x2_user where uid=$datauid ")->queryOne()['image'];
$args = $this->controller->bindActionParams($this, $params); Yii::trace('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); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
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__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); error_reporting(E_ALL); //(new yii\web\Application($config))->run(); (new yii\web\Application($config))->run();
$_GET = [ 'tdkid' => '7', 'id' => '55109', 'page' => '1', ]; $_SERVER = [ 'REDIRECT_UNIQUE_ID' => 'ZgYm8SurS@zD6dK7FHiZOQAAAAA', 'REDIRECT_STATUS' => '200', 'UNIQUE_ID' => 'ZgYm8SurS@zD6dK7FHiZOQAAAAA', 'HTTP_ACCEPT' => '*/*', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_HOST' => 'gre.viplgw.cn', 'PATH' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40', 'SERVER_NAME' => 'gre.viplgw.cn', 'SERVER_ADDR' => '172.18.175.120', 'SERVER_PORT' => '80', 'REMOTE_ADDR' => '44.200.179.138', 'DOCUMENT_ROOT' => '/var/www/html/gre/web', 'REQUEST_SCHEME' => 'http', 'CONTEXT_PREFIX' => '', 'CONTEXT_DOCUMENT_ROOT' => '/var/www/html/gre/web', 'SERVER_ADMIN' => 'root@localhost', 'SCRIPT_FILENAME' => '/var/www/html/gre/web/index.php', 'REMOTE_PORT' => '54272', 'REDIRECT_URL' => '/forum/detail7s55109p1.html', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => '', 'REQUEST_URI' => '/forum/detail7s55109p1.html', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711679217.691, 'REQUEST_TIME' => 1711679217, ]; $_SESSION = [ '__flash' => [], ];