1064 - 您的SQL语法错误 - Joomla网站

时间:2014-03-28 21:51:41

标签: mysql sql joomla syntax-error joomla3.2

我目前正在为使用Joomla的一位客户创建一个网站。我仍然可以访问网站的管理方面,但是,当用户查看网站时,我会看到此错误。

  

1064 - 您的SQL语法出错;检查手册   对应于您的MySQL服务器版本,以便使用正确的语法   在第28行'ORDER BY content.created DESC'附近

    SELECT 
  content.id AS iid,
  content.access AS access,
  categories.title AS catname,
  users.email AS author_email,
  content.created_by_alias AS author_alias,
  content_rating.rating_sum AS rating_sum,
  content_rating.rating_count AS rating_count,
  CASE
    WHEN CHAR_LENGTH(content.alias) 
    THEN CONCAT_WS(":", content.id, content.alias) 
    ELSE content.id 
  END AS id,
  CASE
    WHEN CHAR_LENGTH(categories.alias) 
    THEN CONCAT_WS(
      ":",
      categories.id,
      categories.alias
    ) 
    ELSE categories.id 
  END AS cid 
FROM
  xg6zxarh4_jos_content AS content 
  LEFT JOIN xg6zxarh4_jos_categories AS categories 
    ON categories.id = content.catid 
  LEFT JOIN xg6zxarh4_jos_users AS users 
    ON users.id = content.created_by 
  LEFT JOIN xg6zxarh4_jos_content_rating AS content_rating 
    ON content_rating.content_id = content.id 
WHERE 
ORDER BY content.created DESC

我已经尝试修复Joomla和PHPmyAdmin中的表但无济于事。可能是什么问题?

1 个答案:

答案 0 :(得分:1)

您的WHERE子句为空。

LEFT JOIN xg6zxarh4_jos_content_rating AS content_rating 
    ON content_rating.content_id = content.id 
WHERE <-- HERE
ORDER BY content.created DESC

添加一个条件(即使WHERE 1=1会这样做)或完全删除它。