SQL: use standard LIMIT/OFFSET syntax

Increases compatibility with standard SQL dialect.

Thanks-to: elij <elij.mx@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Dan McGee 2011-04-25 23:23:00 -05:00 committed by Lukas Fleischer
parent ed9c95623f
commit fcda6671f3
4 changed files with 4 additions and 4 deletions

View file

@ -405,7 +405,7 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
break;
}
$search_vars[] = "SB";
$q.= "LIMIT ". $OFFSET . ", " . $HITS_PER_PAGE;
$q.= "LIMIT " . $HITS_PER_PAGE . " OFFSET " . $OFFSET;
$dbh = db_connect();

View file

@ -501,7 +501,7 @@ function pkg_search_page($SID="") {
break;
}
$q_limit = "LIMIT ".$_GET["O"].", ".$_GET["PP"];
$q_limit = "LIMIT ".$_GET["PP"]." OFFSET ".$_GET["O"];
$q = $q_select . $q_from . $q_from_extra . $q_where . $q_sort . $q_limit;
$q_total = "SELECT COUNT(*) " . $q_from . $q_where;