used SQL standard LIMIT/OFFSET, because every database can understand that

This commit is contained in:
Brenda Wallace 2009-06-26 22:13:41 +12:00
parent 63ea2b7c45
commit 1a151ff6f6
1 changed files with 1 additions and 5 deletions

View File

@ -74,11 +74,7 @@ class PopularNoticeSection extends NoticeSection
$offset = 0;
$limit = NOTICES_PER_SECTION + 1;
if (common_config('db', 'type') == 'pgsql') {
$qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
} else {
$qry .= ' LIMIT ' . $offset . ', ' . $limit;
}
$qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
$notice = Memcached_DataObject::cachedQuery('Notice',
sprintf($qry, common_config('popular', 'dropoff')),