0
我有這個問題,因爲我已經將我的網站移動到其他服務器。配置是一樣的,任何提示?Zend框架原則 DBAL 例外 InvalidFieldNameException
文件:
/var/www/page/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:71
消息:
An exception occurred while executing 'SELECT s0_.id AS id_0, s0_.answer AS answer_1, s0_.users_usrId AS users_usrId_2, s0_.question AS question_3 FROM secret_answer s0_ WHERE s0_.users_usrId = ?' with params [83440]:
SQLSTATE [42S22]:柱未找到:1054未知列 's0_.users_usrId' 在 '字段列表'
堆棧跟蹤:
#0 /var/www/page/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(128): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
#1 /var/www/page/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(855): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'SELECT s0_.id A...', Array)
#2 /var/www/page/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Exec/SingleSelectExecutor.php(50): Doctrine\DBAL\Connection->executeQuery('SELECT s0_.id A...', Array, Array, NULL)
#3 /var/www/page/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(321): Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute(Object(Doctrine\DBAL\Connection), Array, Array)
#4 /var/www/page/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(969): Doctrine\ORM\Query->_doExecute()
#5 /var/www/page/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(924): Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache(NULL, NULL)
#6 /var/www/page/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(766): Doctrine\ORM\AbstractQuery->execute(NULL, NULL)
#7 /var/www/page/vendor/custom/p-server-core/src/PServerCore/Entity/Repository/SecretAnswer.php(23): Doctrine\ORM\AbstractQuery->getOneOrNullResult()
#8 /var/www/page/vendor/custom/p-server-core/src/PServerCore/Form/Password.php(85): PServerCore\Entity\Repository\SecretAnswer->getAnswer4UserId(83440)
#9 /var/www/page/vendor/custom/p-server-core/src/PServerCore/Controller/AuthController.php(188): PServerCore\Form\Password->addSecretQuestion(Object(DoctrineORMModule\Proxy\__CG__\PServerCore\Entity\User))
#10 /var/www/page/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): PServerCore\Controller\AuthController->pwLostConfirmAction()
#11 /var/www/page/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#12 /var/www/page/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /var/www/page/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(105): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#14 /var/www/page/vendor/zendframework/zend-mvc/src/DispatchListener.php(119): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#15 /var/www/page/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#16 /var/www/page/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#17 /var/www/page/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#18 /var/www/page/public/index.php(18): Zend\Mvc\Application->run()
#19 {main}
感謝和親切的問候。
你好,表已經在我的舊後端正常工作,只是在當前沒有。 – Dayum
好吧,錯誤告訴我它正在查找表'secret_answer'中的一個字段'users_usrId',它不在那裏。你的模式改變了,你的映射是錯誤的。如果模式和模型配置都正確,我可能會調查'PServerCore \ Entity \ Repository \ SecretAnswer :: getAnswer4UserId'中的查詢,因爲這似乎是查詢拋出錯誤的地方正在被彙編和提交。 – dbrumann
我會看看它。我會盡快讓你失望。再次感謝。 :) – Dayum