Fatal Error in Gdn_Database.Query();

Unknown column 'iu.PhotoID' in 'on clause'

select iu.Email as `InsertEmail`, iu.Signature as `Signature`, d.*, ca.Name as `Category`, ca.UrlCode as `CategoryUrlCode`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, lcu.Name as `LastName`, iu.Name as `InsertName`, iup.Name as `InsertPhoto` from GDN_Discussion d left join GDN_Category ca on d.CategoryID = ca.CategoryID left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 0 left join GDN_User iu on d.InsertUserID = iu.UserID left join GDN_Photo iup on iu.PhotoID = iup.PhotoID left join GDN_Comment lc on d.LastCommentID = lc.CommentID left join GDN_User lcu on lc.InsertUserID = lcu.UserID where d.DiscussionID = :dDiscussionID

The error occurred on or near: /homez.478/dardos/www/foro/library/database/class.database.php

227: 
228:          if (!is_object($PDOStatement)) {
229:             trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
230:          } else if ($PDOStatement->execute($InputParameters) === FALSE) {
231:             trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
232:          }
233:       } else {
234:          $PDOStatement = $this->Connection()->query($Sql);
235:       }

Backtrace:

/homez.478/dardos/www/foro/library/database/class.database.phpPHP::Gdn_ErrorHandler();
[/homez.478/dardos/www/foro/library/database/class.database.php:231] PHP::trigger_error();
[/homez.478/dardos/www/foro/library/database/class.sqldriver.php:1553] Gdn_Database->Query();
[/homez.478/dardos/www/foro/library/database/class.sqldriver.php:632] Gdn_SQLDriver->Query();
[/homez.478/dardos/www/foro/applications/vanilla/models/class.discussionmodel.php:268] Gdn_SQLDriver->Get();
[/homez.478/dardos/www/foro/applications/vanilla/controllers/class.discussioncontroller.php:34] DiscussionModel->GetID();
[/homez.478/dardos/www/foro/library/core/class.dispatcher.php:269] DiscussionController->Index();
[/homez.478/dardos/www/foro/index.php:40] Gdn_Dispatcher->Dispatch();

Variables in local scope:

[Sql] 'select iu.Email as `InsertEmail`, iu.Signature as `Signature`, d.*, ca.Name as `Category`, ca.UrlCode as `CategoryUrlCode`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, lcu.Name as `LastName`, iu.Name as `InsertName`, iup.Name as `InsertPhoto`
from GDN_Discussion d
left join GDN_Category ca on d.CategoryID = ca.CategoryID
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 0
left join GDN_User iu on d.InsertUserID = iu.UserID
left join GDN_Photo iup on iu.PhotoID = iup.PhotoID
left join GDN_Comment lc on d.LastCommentID = lc.CommentID
left join GDN_User lcu on lc.InsertUserID = lcu.UserID
where d.DiscussionID = :dDiscussionID'
[InputParameters] array (
  ':dDiscussionID' => '257',
)
[Event] ''
[PDOStatement] array (
  'queryString' => 'select iu.Email as `InsertEmail`, iu.Signature as `Signature`, d.*, ca.Name as `Category`, ca.UrlCode as `CategoryUrlCode`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, lcu.Name as `LastName`, iu.Name as `InsertName`, iup.Name as `InsertPhoto`
from GDN_Discussion d
left join GDN_Category ca on d.CategoryID = ca.CategoryID
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 0
left join GDN_User iu on d.InsertUserID = iu.UserID
left join GDN_Photo iup on iu.PhotoID = iup.PhotoID
left join GDN_Comment lc on d.LastCommentID = lc.CommentID
left join GDN_User lcu on lc.InsertUserID = lcu.UserID
where d.DiscussionID = :dDiscussionID',
)

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: