Changeset 28559


Ignore:
Timestamp:
05/29/14 07:20:21 (5 years ago)
Author:
rvelices
Message:

simplify batch manager overly complicated and expensive sql call

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/batch_manager_global.php

    r28542 r28559  
    503503  // we need to know the category in which the last photo was added 
    504504  $query = ' 
    505 SELECT 
    506     category_id, 
    507     id_uppercat 
    508   FROM '.IMAGES_TABLE.' AS i 
    509     JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON image_id = i.id 
    510     JOIN '.CATEGORIES_TABLE.' AS c ON category_id = c.id 
    511   ORDER BY i.id DESC 
     505SELECT category_id 
     506  FROM '.IMAGE_CATEGORY_TABLE.' 
     507  ORDER BY image_id DESC 
    512508  LIMIT 1 
    513509;'; 
     
    516512  { 
    517513    $row = pwg_db_fetch_assoc($result); 
    518     $selected_category = array($row['category_id']); 
     514    $selected_category[] = $row['category_id']; 
    519515  } 
    520516} 
Note: See TracChangeset for help on using the changeset viewer.