Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
[Solved] Fatal Error in Gdn_Database.Query*
Candunc
New
Hello, I am trying to host a forum, but whenever I try to create one this shows up:
(Website taken down until fix found)
Fatal Error in Gdn_Database.Query(); [Duplicate entry '1' for key 'PRIMARY' update GDN_User User set Name = :Name, Password = :Password, Email = :Email, ShowEmail = :ShowEmail, Gender = :Gender, DateOfBirth = :DateOfBirth, DateFirstVisit = :DateFirstVisit, DateLastActive = :DateLastActive, DateInserted = :DateInserted, DateUpdated = :DateUpdated, Admin = :Admin, UserID = :UserID The error occurred on or near: B:\Website\Forum1\library\database\class.database.php 276: 277: if (!is_object($PDOStatement)) { 278: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR); 279: } else if ($PDOStatement->execute($InputParameters) === FALSE) { 280: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR); 281: } 282: } else { 283: $PDOStatement = $this->Connection()->query($Sql); 284: } Backtrace: B:\Website\Forum1\library\database\class.database.phpPHP::Gdn_ErrorHandler(); [B:\Website\Forum1\library\database\class.database.php:280] PHP::trigger_error(); [B:\Website\Forum1\library\database\class.sqldriver.php:1650] Gdn_Database->Query(); [B:\Website\Forum1\library\database\class.sqldriver.php:1619] Gdn_SQLDriver->Query(); [B:\Website\Forum1\applications\dashboard\models\class.usermodel.php:968] Gdn_SQLDriver->Put(); [B:\Website\Forum1\applications\dashboard\controllers\class.setupcontroller.php:214] UserModel->SaveAdminUser(); [B:\Website\Forum1\applications\dashboard\controllers\class.setupcontroller.php:71] SetupController->Configure(); [B:\Website\Forum1\applications\dashboard\controllers\class.setupcontroller.php:71] SetupController->Index(); [B:\Website\Forum1\library\core\class.dispatcher.php:322] PHP::call_user_func_array(); [B:\Website\Forum1\index.php:53] Gdn_Dispatcher->Dispatch();
0
Comments
I snipped the part of the error message for you, that is less interesting for solving this problem
Did you install and then try to install again on the same database?
In the database table that the user wants to be inserted, there is already at least 1 user record, so something must be wrong there...
What I would do is:
Just to make sure... did you download and install 2.0.18.4? (latest stable from 'Download' button on top of the site)
There was an error rendering this rich post.
Thanks, I deleted the database and made a new one. It works now.