Fatal Error in Gdn_Database.Query();

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

select u.*, p.Name as `Photo`, i.Name as `InviteName` from GDN_User u left join GDN_Photo p on u.PhotoID = p.PhotoID left join GDN_User i on u.InviteUserID = i.UserID where u.UserID = :uUserID

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/dashboard/models/class.usermodel.php:84] Gdn_SQLDriver->Get();
[/homez.478/dardos/www/foro/applications/dashboard/controllers/class.profilecontroller.php:614] UserModel->Get();
[/homez.478/dardos/www/foro/applications/dashboard/controllers/class.profilecontroller.php:52] ProfileController->GetUserInfo();
[/homez.478/dardos/www/foro/applications/dashboard/controllers/class.profilecontroller.php:168] ProfileController->Activity();
[/homez.478/dardos/www/foro/library/core/class.dispatcher.php:269] ProfileController->Index();
[/homez.478/dardos/www/foro/index.php:40] Gdn_Dispatcher->Dispatch();

Variables in local scope:

[Sql] 'select u.*, p.Name as `Photo`, i.Name as `InviteName`
from GDN_User u
left join GDN_Photo p on u.PhotoID = p.PhotoID
left join GDN_User i on u.InviteUserID = i.UserID
where u.UserID = :uUserID'
[InputParameters] array (
  ':uUserID' => '2085',
)
[Event] ''
[PDOStatement] array (
  'queryString' => 'select u.*, p.Name as `Photo`, i.Name as `InviteName`
from GDN_User u
left join GDN_Photo p on u.PhotoID = p.PhotoID
left join GDN_User i on u.InviteUserID = i.UserID
where u.UserID = :uUserID',
)

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: