首先,我有一个包含数据库的网站。我有2个表(更多,但这些是不相关的)一个叫做用户,另一个称为用户。我有一个测验设置可以与用户一起工作,我的常规登录设置与表用户一起使用。我决定将保存的测验数据(结果,分数等)移动到当时登录的用户。当我将测验数据设置到登录数据库时,我得到了这个:
Details
Type: PDOException Code: 42S22 Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.id' in 'on clause' File: /home/sparkedu/public_html/vendor/j4mie/idiorm/idiorm.php Line: 413 Trace
#0 /home/sparkedu/public_html/vendor/j4mie/idiorm/idiorm.php(413): PDOStatement->execute(Array)
#1 /home/sparkedu/public_html/vendor/j4mie/idiorm/idiorm.php(1605): ORM::_execute('SELECT * FROM `...', Array, 'default')
#2 /home/sparkedu/public_html/vendor/j4mie/idiorm/idiorm.php(650): ORM->_run()
#3 /home/sparkedu/public_html/SimpleQuiz/Utils/LeaderBoard.php(12): ORM->find_array()
#4 /home/sparkedu/public_html/SimpleQuiz/Utils/Quiz.php(193): SimpleQuiz\Utils\LeaderBoard->getMembers('6')
#5 /home/sparkedu/public_html/routes/public.php(54): SimpleQuiz\Utils\Quiz->populateUsers()
#6 [internal function]: {closure}('6')
#7 /home/sparkedu/public_html/vendor/slim/slim/Slim/Route.php(441): call_user_func_array(Object(Closure), Array)
#8 /home/sparkedu/public_html/vendor/slim/slim/Slim/Slim.php(1314): Slim\Route->dispatch()
#9 /home/sparkedu/public_html/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#10 /home/sparkedu/public_html/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#11 /home/sparkedu/public_html/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#12 /home/sparkedu/public_html/vendor/slim/slim/Slim/Slim.php(1261): Slim\Middleware\PrettyExceptions->call()
#13 /home/sparkedu/public_html/public/index.php(64): Slim\Slim->run()
#14 {main}
我尝试创建额外的列,以便保持登录结果(同一行),但它会说未知列,然后我将不得不删除该列来修复它。有什么建议吗?