Database Exception – yii\db\Exception
1. in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Connection.php at line 568
559560561562563564565566567568569570571572573574575576577
$token = 'Opening DB connection: ' . $this->dsn; try { Yii::info($token, __METHOD__); Yii::beginProfile($token, __METHOD__); $this->pdo = $this->createPdoInstance(); $this->initConnection(); Yii::endProfile($token, __METHOD__); } catch (\PDOException $e) { Yii::endProfile($token, __METHOD__); throw new Exception($e->getMessage(), $e->errorInfo, (int) $e->getCode(), $e); } } public function close() {
890891892893894895896897898899900901902
* Returns the PDO instance for the currently active master connection. * This method will open the master DB connection and then return [[pdo]]. * @return PDO the PDO instance for the currently active master connection. */ public function getMasterPdo() { $this->open(); return $this->pdo; }
877878879880881882883884885886887888889
* is available and `$fallbackToMaster` is false. */ public function getSlavePdo($fallbackToMaster = true) { $db = $this->getSlave(false); if ($db === null) { return $fallbackToMaster ? $this->getMasterPdo() : null; } else { return $db->pdo; } }
477478479480481482483484485486487488489
public function quoteValue($str) { if (!is_string($str)) { return $str; } if (($value = $this->db->getSlavePdo()->quote($str)) !== false) { return $value; } else { return "'" . addcslashes(str_replace("'", "''", $str), "\000\n\r\\\032") . "'"; } }
786787788789790791792793794795796797798
* @param string $value string to be quoted * @return string the properly quoted string * @see http: */ public function quoteValue($value) { return $this->getSchema()->quoteValue($value); }
169170171172173174175176177178179180181
$params = []; foreach ($this->params as $name => $value) { if (is_string($name) && strncmp(':', $name, 1)) { $name = ':' . $name; } if (is_string($value)) { $params[$name] = $this->db->quoteValue($value); } elseif (is_bool($value)) { $params[$name] = ($value ? 'TRUE' : 'FALSE'); } elseif ($value === null) { $params[$name] = 'NULL'; } elseif (!is_object($value) && !is_resource($value)) { $params[$name] = $value;
865866867868869870871872873874875876877
* @return mixed the method execution result * @throws Exception if the query causes any problem * @since 2.0.1 this method is protected (was private before). */ protected function queryInternal($method, $fetchMode = null) { $rawSql = $this->getRawSql(); Yii::info($rawSql, 'yii\db\Command::query'); if ($method !== '') { $info = $this->db->getQueryCacheInfo($this->queryCacheDuration, $this->queryCacheDependency); if (is_array($info)) {
370371372373374375376377378379380381382
* @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); }
247248249250251252253254255256257258259
*/ public function one($db = null) { if ($this->emulateExecution) { return false; } return $this->createCommand($db)->queryOne(); }
10. in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/ActiveQuery.php at line 295 – yii\db\Query::one(null)
289290291292293294295296297298299300301
* @return ActiveRecord|array|null a single row of query result. Depending on the setting of [[asArray]], * the query result may be either an array or an ActiveRecord object. `null` will be returned * if the query results in nothing. */ public function one($db = null) { $row = parent::one($db); if ($row !== false) { $models = $this->populate([$row]); return reset($models) ?: null; } else { return null; }
79808182838485868788899091
* @inheritdoc * @return SupeDownItems|array|null */ public function one($db = null) { $this->subTableQuery(); return parent::one($db); } public function count($q = '*', $db = null) { $this->subTableQuery(); if(empty($this->subQuery)){ return parent::count($q, $db);
12. in /www/zy.21cnjy.com/controllers/SiteController.php at line 103 – common\models\ss75\SupeDownItemsQuery::one()
979899100101102103104105106107108109
public function actionDetail($itemid,$ret=false) { $res = SupeDownItems::find() ->where(['itemid'=>$itemid,'flag'=>$this->flag]) ->one(); if(empty($res)){ echo '该资源不存在!'; return false; } if (Yii::$app->request->isPost) {
13. app\controllers\SiteController::actionDetail('19116709', false)
14. in /www/zy.21cnjy.com/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array([app\controllers\SiteController, 'actionDetail'], ['19116709', false])
515253545556575859
$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); } }
150151152153154155156157158159160161162
} $result = null; if ($runAction && $this->beforeAction($action)) { $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); foreach ($modules as $module) {
517518519520521522523524525526527528529
$parts = $this->createController($route); if (is_array($parts)) { 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; }
17. in /www/zy.21cnjy.com/vendor/yiisoft/yii2/web/Application.php at line 102 – yii\base\Module::runAction('site/detail', ['itemid' => '19116709'])
96979899100101102103104105106107108
$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;
374375376377378379380381382383384385386
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();
9101112131415
$config = yii\helpers\ArrayHelper::merge( require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'itemid' => '19116709', ]; $_COOKIE = [ '_csrf' => '0827dd28cb00525afe422095eb66575e484c28d77bb776c04bff19472c946ff6a:2:{i:0;s:5:"_csrf";i:1;s:32:"FW8apKlzMIPua_ex1hFH_2omaZeiASYY";}', 'Hm_lvt_0280ecaa2722243b1de4829d59602c72' => '1731413713', 'HMACCOUNT' => 'CD3CF929DF2D327C', 'Hm_lpvt_0280ecaa2722243b1de4829d59602c72' => '1731415675', ];
网址:Database Exception – yii\db\Exception https://www.yuejiaxmz.com/news/view/60613
相关内容
Database Exception – yii\db\Exception启动系统服务clickhouse报错clickhouse
非法请求
【Java报错已解决】Driver class ‘net.sourceforge.jtds.jdbc.Driver’ could not be found, make sure the
mysql (8)=====用户授权管理
创意生活:如何让食物保存更长时间
问题记录
知识图谱与智能家居的结合:为家庭生活提供智能支持
基于微信小程序的个人账本的设计与实现/个人财务管理系统/基于java的财务管理系统
基于web的家电维修系统/家电维修管理系统