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.

Fatal Error in Gdn_DatabaseDebug.Query();

someday i have this
..

Unknown column 'c.LastCommentID' in 'on clause'
select c.*, lc.DateInserted as `DateLastComment`
from GDN_Category c
left join GDN_Comment lc on c.LastCommentID = lc.CommentID
order by c.TreeLeft asc
The error occurred on or near: /home6/dkpeda/public_html/sarunas/library/database/class.database.php
284: $PDOStatement = $this->Connection()->query($Sql);
285: }
286:
287: if ($PDOStatement === FALSE) {
288: trigger_error(ErrorMessage($this->GetPDOErrorMessage($this->Connection()->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
289: }
290:
291: // Did this query modify data in any way?
292: if ($ReturnType == 'ID') {
Backtrace:
[/home6/dkpeda/public_html/sarunas/library/database/class.database.php:288] PHP::Gdn_ErrorHandler();
[/home6/dkpeda/public_html/sarunas/plugins/Debugger/class.database.debug.php:98] Gdn_Database->Query();
[/home6/dkpeda/public_html/sarunas/library/database/class.sqldriver.php:1648] Gdn_DatabaseDebug->Query();
[/home6/dkpeda/public_html/sarunas/library/database/class.sqldriver.php:673] Gdn_SQLDriver->Query();
[/home6/dkpeda/public_html/sarunas/applications/vanilla/models/class.categorymodel.php:79] Gdn_SQLDriver->Get();
[/home6/dkpeda/public_html/sarunas/applications/vanilla/models/class.categorymodel.php:36] CategoryModel::Categories();
[/home6/dkpeda/public_html/sarunas/applications/vanilla/models/class.categorymodel.php:402] CategoryModel::CategoryWatch();
[/home6/dkpeda/public_html/sarunas/applications/vanilla/modules/class.categoriesmodule.php:24] CategoryModel->GetFull();
[/home6/dkpeda/public_html/sarunas/library/core/class.controller.php:454] CategoriesModule->__construct();
[/home6/dkpeda/public_html/sarunas/applications/vanilla/controllers/class.discussionscontroller.php:87] Gdn_Controller->AddModule();
[/home6/dkpeda/public_html/sarunas/library/core/class.dispatcher.php:291] DiscussionsController->Index();
[/home6/dkpeda/public_html/sarunas/index.php:51] Gdn_Dispatcher->Dispatch();
Queries:
select *
from GDN_Permission Permission
limit 1; 0.002018s
set names 'utf8'; 0.007088s
select MAX(p.`PermissionID`) as `PermissionID`, MAX(p.`Garden.Email.Manage`) as `Garden.Email.Manage`, MAX(p.`Garden.Settings.Manage`) as `Garden.Settings.Manage`, MAX(p.`Garden.Routes.Manage`) as `Garden.Routes.Manage`, MAX(p.`Garden.Messages.Manage`) as `Garden.Messages.Manage`, MAX(p.`Garden.Applications.Manage`) as `Garden.Applications.Manage`, MAX(p.`Garden.Plugins.Manage`) as `Garden.Plugins.Manage`, MAX(p.`Garden.Themes.Manage`) as `Garden.Themes.Manage`, MAX(p.`Garden.SignIn.Allow`) as `Garden.SignIn.Allow`, MAX(p.`Garden.Registration.Manage`) as `Garden.Registration.Manage`, MAX(p.`Garden.Applicants.Manage`) as `Garden.Applicants.Manage`, MAX(p.`Garden.Roles.Manage`) as `Garden.Roles.Manage`, MAX(p.`Garden.Users.Add`) as `Garden.Users.Add`, MAX(p.`Garden.Users.Edit`) as `Garden.Users.Edit`, MAX(p.`Garden.Users.Delete`) as `Garden.Users.Delete`, MAX(p.`Garden.Users.Approve`) as `Garden.Users.Approve`, MAX(p.`Garden.Activity.Delete`) as `Garden.Activity.Delete`, MAX(p.`Vanilla.Settings.Manage`) as `Vanilla.Settings.Manage`, MAX(p.`Vanilla.Categories.Manage`) as `Vanilla.Categories.Manage`, MAX(p.`Vanilla.Spam.Manage`) as `Vanilla.Spam.Manage`, MAX(p.`Vanilla.Discussions.View`) as `Vanilla.Discussions.View`, MAX(p.`Vanilla.Discussions.Add`) as `Vanilla.Discussions.Add`, MAX(p.`Vanilla.Discussions.Edit`) as `Vanilla.Discussions.Edit`, MAX(p.`Vanilla.Discussions.Announce`) as `Vanilla.Discussions.Announce`, MAX(p.`Vanilla.Discussions.Sink`) as `Vanilla.Discussions.Sink`, MAX(p.`Vanilla.Discussions.Close`) as `Vanilla.Discussions.Close`, MAX(p.`Vanilla.Discussions.Delete`) as `Vanilla.Discussions.Delete`, MAX(p.`Vanilla.Comments.Add`) as `Vanilla.Comments.Add`, MAX(p.`Vanilla.Comments.Edit`) as `Vanilla.Comments.Edit`, MAX(p.`Vanilla.Comments.Delete`) as `Vanilla.Comments.Delete`, p.JunctionTable as `JunctionTable`, p.JunctionColumn as `JunctionColumn`, p.JunctionID as `JunctionID`
from GDN_Permission p
join GDN_UserRole ur on p.RoleID = ur.RoleID
where ur.UserID = '0'
group by p.JunctionTable, p.JunctionColumn, p.JunctionID; 0.003138s
select c.*, lc.DateInserted as `DateLastComment`
from GDN_Category c
left join GDN_Comment lc on c.LastCommentID = lc.CommentID
order by c.TreeLeft asc; 0.000000s
Variables in local scope:
[Sql] 'select c.*, lc.DateInserted as `DateLastComment`
from GDN_Category c
left join GDN_Comment lc on c.LastCommentID = lc.CommentID
order by c.TreeLeft asc'
[InputParameters] array (
)
[Options] array (
'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] false
Need Help?
If you are a user of this website, you can report this message to a website administrator.
If you are an administrator of this website, you can get help at the Vanilla Community Forums.
Additional information for support personnel:
Application: Vanilla
Application Version: 2.0.18b2
PHP Version: 5.2.16
Operating System: Linux
Server Software: Apache
Referer: http://www.dk-peda.lv/
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.772.0 Safari/535.1
Request Uri: /sarunas/
Controller: Gdn_DatabaseDebug
Method: Query

AND

Unknown column 'c.LastCommentID' in 'on clause'
select c.*, lc.DateInserted as `DateLastComment` from GDN_Category c left join
GDN_Comment lc on c.LastCommentID = lc.CommentID order by c.TreeLeft asc

After searching I found the column LastCommentID only table
GDN_Discussion, but this is not GDN_Category. Also, the database dkpeda_forum LastCommentID
is the only table GDN_Discussion. One can only conclude, as the website used the wrong
table.

help please :/
Tagged:

Best Answers

  • lucluc ✭✭
    Answer ✓
    Did you upgrade from a previous install (v2 version)?
    If yes, did you run /utility/update or /utility/structure?
  • TimTim Vanilla Staff
    Answer ✓
    Try running /utility/update

    Vanilla Forums COO [GitHub, Twitter, About.me]

Answers

Sign In or Register to comment.