diff --git a/include/ws_functions/pwg.categories.php b/include/ws_functions/pwg.categories.php index 38357c6b3..897d4d416 100644 --- a/include/ws_functions/pwg.categories.php +++ b/include/ws_functions/pwg.categories.php @@ -116,6 +116,8 @@ SELECT SQL_CALC_FOUND_ROWS i.* $images[] = $image; } + list($total_images) = pwg_db_fetch_row(pwg_query('SELECT FOUND_ROWS()')); + // let's take care of adding the related albums to each photo if (count($image_ids) > 0) { @@ -189,8 +191,6 @@ SELECT } } - list($total_images) = pwg_db_fetch_row(pwg_query('SELECT FOUND_ROWS()')); - return array( 'paging' => new PwgNamedStruct( array(