Make sqlite limit statement more different than mysql limit statement

This commit is contained in:
Timothy Warren 2014-03-26 21:19:24 -04:00
parent 50cfa0f888
commit 3a16f3c65b
1 changed files with 5 additions and 3 deletions

View File

@ -31,12 +31,14 @@ class SQLite_SQL implements iDB_SQL {
*/ */
public function limit($sql, $limit, $offset=FALSE) public function limit($sql, $limit, $offset=FALSE)
{ {
if ( ! is_numeric($offset)) $sql .= "\nLIMIT {$limit}";
if (is_numeric($offset))
{ {
return $sql."\nLIMIT {$limit}"; $sql .= " OFFSET {$offset}";
} }
return $sql."\nLIMIT {$limit} OFFSET {$offset}"; return $sql;
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------