Perşembe, Eylül 18, 2008

Mambo change 2

A new problem with com_events and mysql 5.0
DB function failed with error number 1054
Unknown column
'a.checked_out' in 'on clause' SQL=SELECT a.*, cc.name AS category,
u.name AS editor, g.name AS groupname FROM jos_events AS a,
jos_categories AS cc LEFT JOIN jos_users AS u ON u.id = a.checked_out
LEFT JOIN jos_groups AS g ON g.id = a.access WHERE a.catid=cc.id ORDER
BY a.catid LIMIT 0,30
And the solution:
This query is the one that fails, and appears around line 226. This
is the fixed version and has had brackets added in line 227 in the FROM
clause, like so-
Code:
   $database->setQuery( "SELECT a.*, cc.name AS category, u.name AS editor, g.name AS groupname"
      . "\nFROM (#__events AS a, #__categories AS cc)"
      . "\nLEFT JOIN #__users AS u ON u.id = a.checked_out"
      . "\nLEFT JOIN #__groups AS g ON g.id = a.access"
      . (count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : "")
      . "\nORDER BY a.catid"
      //. "\nAND a.state ASC"
      . "\nLIMIT $limitstart,$limit"
   );

Hiç yorum yok: