Database Exception – yii\db\Exception

发布时间:2024-11-22 13:04

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; } }

213214215216217218219220221222223224225

if ($this->db->getTransaction()) { $forRead = false; } if ($forRead || $forRead === null && $this->db->getSchema()->isReadQuery($sql)) { $pdo = $this->db->getSlavePdo(); } else { $pdo = $this->db->getMasterPdo(); } try { $this->pdoStatement = $pdo->prepare($sql);

890891892893894895896897898899900901902

Yii::trace('Query result served from cache', 'yii\db\Command::query'); return $result[0]; } } } $this->prepare(true); $token = $rawSql; try { Yii::beginProfile($token, 'yii\db\Command::query'); $this->pdoStatement->execute();

356357358359360361362363364365366367368

* @return array all rows of the query result. Each array element is an array representing a row of data. * An empty array is returned if the query results in nothing. * @throws Exception execution failed */ public function queryAll($fetchMode = null) { return $this->queryInternal('fetchAll', $fetchMode); }

193194195196197198199200201202203204205

* @throws \Exception if DB query fails */ protected function findColumns($table) { $sql = 'SHOW FULL COLUMNS FROM ' . $this->quoteTableName($table->fullName); try { $columns = $this->db->createCommand($sql)->queryAll(); } catch (\Exception $e) { $previous = $e->getPrevious(); if ($previous instanceof \PDOException && strpos($previous->getMessage(), 'SQLSTATE[42S02') !== false) { return false;

9293949596979899100101102103104

*/ protected function loadTableSchema($name) { $table = new TableSchema; $this->resolveTableNames($table, $name); if ($this->findColumns($table)) { $this->findConstraints($table); return $table; } else { return null; }

146147148149150151152153154155156157158

} return $this->_tables[$name]; } } return $this->_tables[$name] = $this->loadTableSchema($realName); }

324325326327328329330331332333334335336

* @throws InvalidConfigException if the table for the AR class does not exist. */ public static function getTableSchema() { $tableSchema = static::getDb() ->getSchema() ->getTableSchema(static::tableName()); if ($tableSchema === null) { throw new InvalidConfigException('The table does not exist: ' . static::tableName()); } return $tableSchema;

348349350351352353354355356357358359360

* Note that an array should be returned even for a table with single primary key. * * @return string[] the primary keys of the associated database table. */ public static function primaryKey() { return static::getTableSchema()->primaryKey; }

170171172173174175176177178179180181182

protected static function findByCondition($condition) { $query = static::find(); if (!ArrayHelper::isAssociative($condition)) { $primaryKey = static::primaryKey(); if (isset($primaryKey[0])) { $pk = $primaryKey[0]; if (!empty($query->join) || !empty($query->joinWith)) { $pk = static::tableName() . '.' . $pk; } $condition = [$pk => $condition];

101102103104105106107108109110111112113

public static function findOne($condition) { return static::findByCondition($condition)->one(); }

172173174175176177178179180181182183184

if (!empty($Asset->itemid)) { $res->subject = $Asset->title; $res->softintro = $Asset->intro; } } $res1 = X2Category::findOne($res->catid); $parentpath_arr = []; if(!empty($res1)){ $parentpath_arr = explode(',', $res1->parentpath); $parentpath_arr[] = $res->catid; array_shift($parentpath_arr); foreach($parentpath_arr as $k => $v){

15. app\controllers\SiteController::actionDetail('21308363', false)

16. in /www/zy.21cnjy.com/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array([app\controllers\SiteController, 'actionDetail'], ['21308363', 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; }

19. in /www/zy.21cnjy.com/vendor/yiisoft/yii2/web/Application.php at line 102 – yii\base\Module::runAction('site/detail', ['itemid' => '21308363'])

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' => '21308363', ]; $_COOKIE = [ '_csrf' => 'dfeb96d291e839c061e5a33a1228bc5b14d4d7cfc0ef3d85e46c1af8db05806ba:2:{i:0;s:5:"_csrf";i:1;s:32:"PN3-54Dpa8XbLDj62dWU5qgVb6Ui4A7s";}', 'Hm_lvt_0280ecaa2722243b1de4829d59602c72' => '1732251043', 'HMACCOUNT' => '162CB75FAABDA8B9', 'Hm_lpvt_0280ecaa2722243b1de4829d59602c72' => '1732251048', ];

网址:Database Exception – yii\db\Exception https://www.yuejiaxmz.com/news/view/191104

相关内容

Database Exception – yii\db\Exception
Database Exception – yii\db\Exception
Database Exception – yii\db\Exception
Database Exception – yii\db\Exception
Database Exception – yii\db\Exception
Database Exception – yii\db\Exception
Database Exception – yii\db\Exception
mongodb实现简单的增删改查
启动系统服务clickhouse报错clickhouse
JAVA RSA

随便看看