From: garvinhicking Date: Mon, 19 Sep 2005 15:21:21 +0000 (+0000) Subject: (Hopefully) fix postgreSQL error X-Git-Tag: 0.9~136 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=76d3a2f478606abb1262182ee03d39a66a282bb2;p=s9y.git (Hopefully) fix postgreSQL error --- diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 52b4c64..d55124a 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -430,8 +430,23 @@ function serendipity_fetchCategories($authorid = null, $name = null, $order = nu $where .= " c.category_name = '" . serendipity_db_escape_string($name) . "'"; } - $querystring = "SELECT - c.*, + if ($serendipity['dbType'] == 'postgres') { + $group = ''; + $distinct = 'DISTINCT'; + } else { + $group = 'GROUP BY c.categoryid'; + $distinct = ''; + } + + $querystring = "SELECT $distinct c.categoryid, + c.category_name, + c.category_icon, + c.category_description, + c.authorid, + c.category_left, + c.category_right, + c.parentid, + a.username, a.realname FROM {$serendipity['dbPrefix']}category AS c @@ -442,7 +457,7 @@ function serendipity_fetchCategories($authorid = null, $name = null, $order = nu LEFT OUTER JOIN {$serendipity['dbPrefix']}access AS acl ON (ag.groupid = acl.groupid AND acl.artifact_id = c.categoryid) $where - GROUP BY c.categoryid"; + $group"; if (!empty($order)) { $querystring .= "\n ORDER BY $order";