diff options
Diffstat (limited to 'phpBB/db/mysql.php')
-rw-r--r-- | phpBB/db/mysql.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/phpBB/db/mysql.php b/phpBB/db/mysql.php index fe18cffa89..8433deb7d8 100644 --- a/phpBB/db/mysql.php +++ b/phpBB/db/mysql.php @@ -210,7 +210,6 @@ class sql_db } // 20030406 Ashe: switched up $total and $offset as per MySQL manual - // Note for other DBALs: if $total == -1 we only want to set an offset (no pun intended) function sql_query_limit($query, $total, $offset = 0, $expire_time = 0) { if ($query != '') @@ -218,6 +217,12 @@ class sql_db $this->query_result = false; $this->num_queries++; + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) + { + $total = -1; + } + $query .= ' LIMIT ' . ((!empty($offset)) ? "$offset, $total" : $total); return $this->sql_query($query, $expire_time); |