Index: /trunk/admin/cat_perm.php
===================================================================
--- /trunk/admin/cat_perm.php	(revision 4330)
+++ /trunk/admin/cat_perm.php	(revision 4331)
@@ -60,5 +60,5 @@
   FROM '.CATEGORIES_TABLE.'
   WHERE status = \'private\'
-  LIMIT 0,1
+  LIMIT 0 OFFSET 1
 ;';
 
Index: /trunk/admin/element_set_global.php
===================================================================
--- /trunk/admin/element_set_global.php	(revision 4330)
+++ /trunk/admin/element_set_global.php	(revision 4331)
@@ -475,5 +475,5 @@
   WHERE id IN ('.implode(',', $page['cat_elements_id']).')
   '.$conf['order_by'].'
-  LIMIT '.$page['start'].', '.$page['nb_images'].'
+  LIMIT '.$page['start'].' OFFSET '.$page['nb_images'].'
 ;';
   //echo '<pre>'.$query.'</pre>';
Index: /trunk/admin/element_set_unit.php
===================================================================
--- /trunk/admin/element_set_unit.php	(revision 4330)
+++ /trunk/admin/element_set_unit.php	(revision 4331)
@@ -197,5 +197,5 @@
   WHERE id IN ('.implode(',', $page['cat_elements_id']).')
   '.$conf['order_by'].'
-  LIMIT '.$page['start'].', '.$page['nb_images'].'
+  LIMIT '.$page['start'].' OFFSET '.$page['nb_images'].'
 ;';
   $result = pwg_query($query);
Index: /trunk/admin/include/functions.php
===================================================================
--- /trunk/admin/include/functions.php	(revision 4330)
+++ /trunk/admin/include/functions.php	(revision 4331)
@@ -597,6 +597,6 @@
   FROM '.IMAGE_CATEGORY_TABLE.'
   WHERE category_id = '.$category_id.'
-  ORDER BY RAND()
-  LIMIT 0,1
+  ORDER BY '.DB_RANDOM_FUNCTION.'()
+  LIMIT 0 OFFSET 1
 ;';
     list($representative) = pwg_db_fetch_row(pwg_query($query));
Index: /trunk/admin/include/functions_history.inc.php
===================================================================
--- /trunk/admin/include/functions_history.inc.php	(revision 4330)
+++ /trunk/admin/include/functions_history.inc.php	(revision 4331)
@@ -162,5 +162,5 @@
 ;';
 
-  // LIMIT '.$page['start'].', '.$conf['nb_logs_page'].'
+  // LIMIT '.$page['start'].' OFFSET '.$conf['nb_logs_page'].'
 
   $result = pwg_query($query);
Index: /trunk/admin/rating.php
===================================================================
--- /trunk/admin/rating.php	(revision 4330)
+++ /trunk/admin/rating.php	(revision 4331)
@@ -177,5 +177,5 @@
   GROUP BY r.element_id
   ORDER BY ' . $available_order_by[$order_by_index][1] .'
-  LIMIT '.$start.','.$elements_per_page.'
+  LIMIT '.$start.' OFFSET '.$elements_per_page.'
 ;';
 
Index: /trunk/comments.php
===================================================================
--- /trunk/comments.php	(revision 4330)
+++ /trunk/comments.php	(revision 4331)
@@ -327,5 +327,5 @@
 {
   $query.= '
-  LIMIT '.$start.','.$page['items_number'];
+  LIMIT '.$start.' OFFSET '.$page['items_number'];
 }
 $query.= '
Index: /trunk/include/calendar_monthly.class.php
===================================================================
--- /trunk/include/calendar_monthly.class.php	(revision 4330)
+++ /trunk/include/calendar_monthly.class.php	(revision 4331)
@@ -349,5 +349,5 @@
     $query.= '
   ORDER BY RAND()
-  LIMIT 0,1';
+  LIMIT 0 OFFSET 1';
     unset ( $page['chronology_date'][CDAY] );
 
Index: /trunk/include/functions_notification.inc.php
===================================================================
--- /trunk/include/functions_notification.inc.php	(revision 4330)
+++ /trunk/include/functions_notification.inc.php	(revision 4331)
@@ -445,5 +445,5 @@
   GROUP BY date_available
   ORDER BY date_available DESC
-  LIMIT 0,'.$max_dates.'
+  LIMIT 0 OFFSET '.$max_dates.'
 ;';
   $result = pwg_query($query);
@@ -465,5 +465,5 @@
     AND tn_ext IS NOT NULL
   ORDER BY RAND(NOW())
-  LIMIT 0,'.$max_elements.'
+  LIMIT 0 OFFSET '.$max_elements.'
 ;';
       $dates[$i]['elements'] = array();
@@ -485,5 +485,5 @@
   GROUP BY category_id
   ORDER BY img_count DESC
-  LIMIT 0,'.$max_cats.'
+  LIMIT 0 OFFSET '.$max_cats.'
 ;';
       $dates[$i]['categories'] = array();
Index: /trunk/include/picture_comment.inc.php
===================================================================
--- /trunk/include/picture_comment.inc.php	(revision 4330)
+++ /trunk/include/picture_comment.inc.php	(revision 4331)
@@ -137,5 +137,5 @@
 $validated_clause.'
   ORDER BY date ASC
-  LIMIT '.$page['start'].', '.$conf['nb_comment_page'].'
+  LIMIT '.$page['start'].' OFFSET '.$conf['nb_comment_page'].'
 ;';
     $result = pwg_query( $query );
Index: /trunk/include/ws_functions.inc.php
===================================================================
--- /trunk/include/ws_functions.inc.php	(revision 4330)
+++ /trunk/include/ws_functions.inc.php	(revision 4331)
@@ -293,5 +293,5 @@
 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);
@@ -684,5 +684,5 @@
   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);
@@ -1399,5 +1399,5 @@
     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);
