aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/calendar_monthly.class.php2
-rw-r--r--include/category_cats.inc.php4
-rw-r--r--include/functions_notification.inc.php6
-rw-r--r--include/functions_tag.inc.php2
-rw-r--r--include/section_init.inc.php4
-rw-r--r--include/ws_functions.inc.php8
6 files changed, 13 insertions, 13 deletions
diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php
index 1a4e70ce3..0bd68ee1e 100644
--- a/include/calendar_monthly.class.php
+++ b/include/calendar_monthly.class.php
@@ -348,7 +348,7 @@ SELECT id, file,tn_ext,path, width, height, DAYOFWEEK('.$this->date_field.')-1 a
$query.= $this->get_date_where();
$query.= '
ORDER BY RAND()
- LIMIT 0 OFFSET 1';
+ LIMIT 1';
unset ( $page['chronology_date'][CDAY] );
$row = pwg_db_fetch_assoc(pwg_query($query));
diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php
index 0d35d4a85..dfd009519 100644
--- a/include/category_cats.inc.php
+++ b/include/category_cats.inc.php
@@ -105,7 +105,7 @@ SELECT image_id
"\n AND"
).'
ORDER BY RAND()
- LIMIT 0,1
+ LIMIT 1
;';
$subresult = pwg_query($query);
if (pwg_db_num_rows($subresult) > 0)
@@ -133,7 +133,7 @@ SELECT image_id
"\n AND"
).'
ORDER BY RAND()
- LIMIT 0,1
+ LIMIT 1
;';
$subresult = pwg_query($query);
if (pwg_db_num_rows($subresult) > 0)
diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php
index b48fd35be..58091786a 100644
--- a/include/functions_notification.inc.php
+++ b/include/functions_notification.inc.php
@@ -444,7 +444,7 @@ SELECT date_available,
'.$where_sql.'
GROUP BY date_available
ORDER BY date_available DESC
- LIMIT 0 OFFSET '.$max_dates.'
+ LIMIT '.$max_dates.'
;';
$result = pwg_query($query);
$dates = array();
@@ -464,7 +464,7 @@ SELECT DISTINCT id, path, name, tn_ext, file
AND date_available="'.$dates[$i]['date_available'].'"
AND tn_ext IS NOT NULL
ORDER BY RAND(NOW())
- LIMIT 0 OFFSET '.$max_elements.'
+ LIMIT '.$max_elements.'
;';
$dates[$i]['elements'] = array();
$result = pwg_query($query);
@@ -484,7 +484,7 @@ SELECT DISTINCT c.uppercats, COUNT(DISTINCT i.id) img_count
AND date_available="'.$dates[$i]['date_available'].'"
GROUP BY category_id
ORDER BY img_count DESC
- LIMIT 0 OFFSET '.$max_cats.'
+ LIMIT '.$max_cats.'
;';
$dates[$i]['categories'] = array();
$result = pwg_query($query);
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index c3978ad39..a05174159 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -239,7 +239,7 @@ SELECT t.*, count(*) counter
{
$query .= '
ORDER BY counter DESC
- LIMIT 0,'.$max_tags;
+ LIMIT '.$max_tags;
}
else
{
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index 59809dad6..ce3e3a553 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -490,7 +490,7 @@ SELECT DISTINCT(id)
WHERE hit > 0
'.$forbidden.'
'.$conf['order_by'].'
- LIMIT 0, '.$conf['top_number'].'
+ LIMIT '.$conf['top_number'].'
;';
$page = array_merge(
@@ -517,7 +517,7 @@ SELECT DISTINCT(id)
WHERE average_rate IS NOT NULL
'.$forbidden.'
'.$conf['order_by'].'
- LIMIT 0, '.$conf['top_number'].'
+ LIMIT '.$conf['top_number'].'
;';
$page = array_merge(
$page,
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index da1d7e06f..9adcaf208 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -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']).' OFFSET '.(int)$params['per_page'];
+LIMIT '.(int)$params['per_page'].' OFFSET '.(int)($params['per_page']*$params['page']);
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))
@@ -682,8 +682,8 @@ SELECT id, date, author, content
FROM '.COMMENTS_TABLE.'
WHERE '.$where_comments.'
ORDER BY date
- LIMIT '.(int)($params['comments_per_page']*$params['comments_page']).
- ' OFFSET '.(int)$params['comments_per_page'];
+ LIMIT '.(int)$params['comments_per_page'].
+ ' OFFSET '.(int)($params['comments_per_page']*$params['comments_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']).' OFFSET '.(int)$params['per_page'];
+LIMIT '.(int)$params['per_page'].' OFFSET '.(int)($params['per_page']*$params['page']);
$result = pwg_query($query);
while ($row = pwg_db_fetch_assoc($result))