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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user