mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
Feature 1255 : improve sql
Replace in queries LIMIT N,M by LIMIT N OFFSET M git-svn-id: http://piwigo.org/svn/trunk@4331 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -292,7 +292,7 @@ SELECT i.*, GROUP_CONCAT(category_id) cat_ids
|
||||
AND ', $where_clauses).'
|
||||
GROUP BY i.id
|
||||
'.$order_by.'
|
||||
LIMIT '.(int)($params['per_page']*$params['page']).','.(int)$params['per_page'];
|
||||
LIMIT '.(int)($params['per_page']*$params['page']).' OFFSET '.(int)$params['per_page'];
|
||||
|
||||
$result = pwg_query($query);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
@@ -683,7 +683,7 @@ SELECT id, date, author, content
|
||||
WHERE '.$where_comments.'
|
||||
ORDER BY date
|
||||
LIMIT '.(int)($params['comments_per_page']*$params['comments_page']).
|
||||
','.(int)$params['comments_per_page'];
|
||||
' OFFSET '.(int)$params['comments_per_page'];
|
||||
|
||||
$result = pwg_query($query);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
@@ -1398,7 +1398,7 @@ SELECT DISTINCT i.* FROM '.IMAGES_TABLE.' i
|
||||
WHERE '. implode('
|
||||
AND ', $where_clauses).'
|
||||
'.$order_by.'
|
||||
LIMIT '.(int)($params['per_page']*$params['page']).','.(int)$params['per_page'];
|
||||
LIMIT '.(int)($params['per_page']*$params['page']).' OFFSET '.(int)$params['per_page'];
|
||||
|
||||
$result = pwg_query($query);
|
||||
while ($row = pwg_db_fetch_assoc($result))
|
||||
|
||||
Reference in New Issue
Block a user