Ignore:
Timestamp:
11/21/09 13:15:22 (10 years ago)
Author:
nikrou
Message:

Feature 1255 : improve sql
Replace in queries LIMIT N,M by LIMIT N OFFSET M

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r4325 r4331  
    293293GROUP BY i.id 
    294294'.$order_by.' 
    295 LIMIT '.(int)($params['per_page']*$params['page']).','.(int)$params['per_page']; 
     295LIMIT '.(int)($params['per_page']*$params['page']).' OFFSET '.(int)$params['per_page']; 
    296296 
    297297    $result = pwg_query($query); 
     
    684684  ORDER BY date 
    685685  LIMIT '.(int)($params['comments_per_page']*$params['comments_page']). 
    686     ','.(int)$params['comments_per_page']; 
     686    ' OFFSET '.(int)$params['comments_per_page']; 
    687687 
    688688    $result = pwg_query($query); 
     
    13991399    AND ', $where_clauses).' 
    14001400'.$order_by.' 
    1401 LIMIT '.(int)($params['per_page']*$params['page']).','.(int)$params['per_page']; 
     1401LIMIT '.(int)($params['per_page']*$params['page']).' OFFSET '.(int)$params['per_page']; 
    14021402 
    14031403    $result = pwg_query($query); 
Note: See TracChangeset for help on using the changeset viewer.