aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2014-05-29 05:20:21 +0000
committerrvelices <rv-github@modusoptimus.com>2014-05-29 05:20:21 +0000
commit8aaa3612eba4094eeb1dadce4d11ce553cc10ed4 (patch)
treed6c4f55e7468f3ef762d08a22d5a35069722c53a
parent20919c9875955a564b1a0c60cdcabdfe2de823a5 (diff)
simplify batch manager overly complicated and expensive sql call
git-svn-id: http://piwigo.org/svn/trunk@28559 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/batch_manager_global.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php
index 26e0e7660..9cfd6ab14 100644
--- a/admin/batch_manager_global.php
+++ b/admin/batch_manager_global.php
@@ -502,20 +502,16 @@ else
{
// we need to know the category in which the last photo was added
$query = '
-SELECT
- category_id,
- id_uppercat
- FROM '.IMAGES_TABLE.' AS i
- JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON image_id = i.id
- JOIN '.CATEGORIES_TABLE.' AS c ON category_id = c.id
- ORDER BY i.id DESC
+SELECT category_id
+ FROM '.IMAGE_CATEGORY_TABLE.'
+ ORDER BY image_id DESC
LIMIT 1
;';
$result = pwg_query($query);
if (pwg_db_num_rows($result) > 0)
{
$row = pwg_db_fetch_assoc($result);
- $selected_category = array($row['category_id']);
+ $selected_category[] = $row['category_id'];
}
}