1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

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
This commit is contained in:
Ludovic Arnaud
2003-03-06 03:04:29 +00:00
parent 2d52ece84f
commit 575d170365
2 changed files with 9 additions and 2 deletions

View File

@@ -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);