Bug 1754 fixed : The keyword AS is mandatory for alias in PostgreSQL queries

git-svn-id: http://piwigo.org/svn/trunk@6652 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
nikrou
2010-07-03 12:12:25 +00:00
parent 58cb482d7a
commit dd955526ae
4 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -476,8 +476,8 @@ function get_recent_post_dates($max_dates, $max_elements, $max_cats)
$query = '
SELECT date_available,
COUNT(DISTINCT id) nb_elements,
COUNT(DISTINCT category_id) nb_cats
COUNT(DISTINCT id) AS nb_elements,
COUNT(DISTINCT category_id) AS nb_cats
FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=image_id
'.$where_sql.'
GROUP BY date_available
@@ -515,7 +515,7 @@ SELECT id, path, name, tn_ext, file
if ($max_cats>0)
{// get some categories ...
$query = '
SELECT c.uppercats, COUNT(DISTINCT i.id) img_count
SELECT c.uppercats, COUNT(DISTINCT i.id) AS img_count
FROM '.IMAGES_TABLE.' i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON i.id=image_id
INNER JOIN '.CATEGORIES_TABLE.' c ON c.id=category_id
'.$where_sql.'