Database Exception – yii\db\Exception

2026-11-29 0 1

1.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Connection.php
at line

568559560561562563564565566567568569570571572573574575576577$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__);

thrownewException($e->getMessage(), $e->errorInfo, (int) $e->getCode(), $e);
}
}

/**
* Closes the currently active DB connection.
* It does nothing if the connection is already closed.
*/

publicfunctionclose()
{2.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Connection.php
at line

896
– yii\db\Connection::open() 890891892893894

895896897898899900901902 * 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.
*/
publicfunctiongetMasterPdo()
{$this->open();

return$this->pdo;
}

/**
* Returns the currently active slave connection.
* If this method is called for the first time, it will try to open a slave connection when [[enableSlaves]] is true.

3.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Connection.php
at line

883
– yii\db\Connection::getMasterPdo() 877878879

880881882883884885886887888889 * is available and `$fallbackToMaster` is false.
*/
public

functiongetSlavePdo($fallbackToMaster = true)
{$db = $this->getSlave(false);
if ($db ===

null) {
return$fallbackToMaster ? $this->getMasterPdo() : null;
} else {

return$db->pdo;
}
}

/**
4.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Schema.php
at line

483
– yii\db\Connection::getSlavePdo() 477478479

480481482483484485486487488489publicfunctionquoteValue($str)
{if (!is_string($str)) {

return$str;
}

if (($value = $this->db->getSlavePdo()->quote($str)) !== false) {

return$value;
} else {
// the driver doesn’t support quote (e.g. oci)return”‘” . addcslashes(str_replace(

“‘”, “””, $str), “\000\n\r\\\032”) . “‘”;
}
}
5.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Connection.php

at line 792
– yii\db\Schema::quoteValue

(‘27034009’) 786787788789790791792793794795796797798 * @param string $value string to be quoted
* @

return string the properly quoted string
* @see http://www.php.net/manual/en/function.PDO-quote.php

*/
publicfunctionquoteValue($value)
{return$this->getSchema()->quoteValue($value);
}

/**
* Quotes a table name for use in a query.
* If the table name contains schema prefix, the prefix will also be properly quoted.
* If the table name is already quoted or contains special characters including ‘(‘, ‘[[‘ and ‘{{‘,

6.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Command.php
at line 175

– yii\db\Connection::quoteValue(‘27034009’) 169

170171172173174175176177178179180181$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;
7.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Command.php

at line 871
– yii\db\Command::getRawSql

() 865866867868869870871872873874875876877 * @return mixed the method execution result
* @throws

Exceptionif the query causes any problem
* @since 2.0.1this method is protected (was private before).
*/

protectedfunctionqueryInternal($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)) {
8.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Command.php

at line 376
– yii\db\Command::queryInternal

(‘fetch’, null) 370371372373374375376377378379380381382 * @returnarray|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
*/
publicfunctionqueryOne($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|false the value of the first column in the first row of the query result.
9.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/db/Query.php

at line 253
– yii\db\Command::queryOne

() 247248249250251252253254255256257258259 */
publicfunctionone($db = null)
{

if ($this->emulateExecution) {
returnfalse;
}
return$this->createCommand(

$db)->queryOne();
}

/**
* Returns the query result as a scalar value.
* The value returned will be the first column in the first row of the query results.
*

@param Connection $db the database connection used to generate the SQL statement.
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

arrayor an ActiveRecord object. `null` will be returned
* if the query results in nothing.
*/

publicfunctionone($db = null)
{$row = parent::one($db);
if ($row !== false) {

$models = $this->populate([$row]);
return reset($models) ?: null;
} else {

returnnull;
}
11.in /www/zy.21cnjy.com/common/models/ss75/SupeDownItemsQuery.php
at line

85
– yii\db\ActiveQuery::one(null) 798081828384

85868788899091 * @inheritdoc
* @return SupeDownItems|array|null
*/
publicfunctionone

($db = null)
{$this->subTableQuery();
returnparent::one($db);
}

publicfunctioncount

($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// $ret 是否返回Detail jsonpublicfunctionactionDetail($itemid,$ret=false)

{$res = SupeDownItems::find()
->where([‘itemid’=>$itemid,’flag’=>$this->flag])
->one();

if(empty($res)){
echo’该资源不存在!’;
returnfalse;
}
//seo优化执行修改标题 如果不存在就插入

if (Yii::$app->request->isPost) {
13.
app\controllers\SiteController::actionDetail(

‘27034009’, false) 14.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/base/InlineAction.php
at line

57
– call_user_func_array([app\controllers\SiteController, ‘actionDetail’

], [‘27034009’, 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

);
}
}
15.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/base/Controller.php
at line

156
– yii\base\InlineAction::runWithParams([‘itemid’ => ‘27034009’

]) 150151152153154155156157158159160161162 }

$result = null;

if ($runAction && $this->beforeAction($action)) {
// run the action$result = $action->runWithParams(

$params);

$result = $this->afterAction($action, $result);

// call afterAction on modules

foreach ($modulesas$module) {
/* @var $module Module */16.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/base/Module.php

at line 523
– yii\base\Controller::runAction

(‘detail’, [‘itemid’ => ‘27034009’]) 517518519520521522523524525526527528529$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;
}
17.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/web/Application.php
at line

102
– yii\base\Module::runAction(‘site/detail’, [‘itemid’ => ‘27034009’

]) 96979899100101102103104105106107108$params = $this->catchAll;
unset($params

[0]);
}
try {
Yii::trace(“Route requested: ‘$route'”, __METHOD__);

$this->requestedRoute = $route;
$result = $this->runAction($route, $params);

if ($resultinstanceof Response) {
return$result;
} else {

$response = $this->getResponse();
if ($result !== null) {
$response

->data = $result;
18.in /www/zy.21cnjy.com/vendor/yiisoft/yii2/base/Application.php
at line

380
– yii\web\Application::handleRequest(yii\web\Request)

374375376377378379380381382383384385386try {

$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();
19.in /www/zy.21cnjy.com/web/index.php
at line 15
–

yii\base\Application::run() 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();

声明: 本文部分内容及图片来源于网络,由本站编辑整理,仅用于学习交流,版权归原作者所有。如有侵权,请联系我们删除。联系邮箱:3454251265@qq.com

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

「米云软件」 AIGC Database Exception – yii\db\Exception https://www.miyunrj.com/aigc/12454.html

常见问题

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务