aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/db/mysql.php
diff options
context:
space:
mode:
authorLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2003-03-06 03:04:29 +0000
committerLudovic Arnaud <ludovic_arnaud@users.sourceforge.net>2003-03-06 03:04:29 +0000
commit575d1703656f56560fe36ab87931fd7b99b7d7e2 (patch)
tree17cffeeba57669c1b64472c2690984ccaa0ba734 /phpBB/db/mysql.php
parent2d52ece84f75abd1d4b35be62775446a49dc25da (diff)
downloadforums-575d1703656f56560fe36ab87931fd7b99b7d7e2.tar
forums-575d1703656f56560fe36ab87931fd7b99b7d7e2.tar.gz
forums-575d1703656f56560fe36ab87931fd7b99b7d7e2.tar.bz2
forums-575d1703656f56560fe36ab87931fd7b99b7d7e2.tar.xz
forums-575d1703656f56560fe36ab87931fd7b99b7d7e2.zip
The last one for today. As of now, sql_query_limit($sql, 0) will _not_ limit the number of rows that are affected.
git-svn-id: file:///svn/phpbb/trunk@3608 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/db/mysql.php')
-rw-r--r--phpBB/db/mysql.php7
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);