fixes #1871 move the retrieve of the number of queried rows

The FOUND_ROWS() must be performed right after the SQL_CALC_FOUND_ROWS but commit 4d81d28eca had added some new SQL queries in between.
This commit is contained in:
plegall 2023-02-21 15:17:24 +01:00
parent 55610206ee
commit b9ddcf17f1

View file

@ -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(