mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Fixed a couple of limit & fetchrowset issues
git-svn-id: file:///svn/phpbb/trunk@15 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
7cde919ef0
commit
7fee269d2f
1 changed files with 5 additions and 6 deletions
|
@ -123,7 +123,7 @@ class sql_db
|
||||||
//
|
//
|
||||||
if(eregi(" LIMIT ", $query))
|
if(eregi(" LIMIT ", $query))
|
||||||
{
|
{
|
||||||
eregi("^([a-zA-Z0-9 \*\,\'\"\+\?\.]+) LIMIT ([0-9]+)[, ]*([0-9]+)*", $query, $limits);
|
eregi("^([a-zA-Z0-9 \*\,\'\"\+\?\.\(\)]+) LIMIT ([0-9]+)[, ]*([0-9]+)*", $query, $limits);
|
||||||
|
|
||||||
$query = $limits[1];
|
$query = $limits[1];
|
||||||
if($limits[3])
|
if($limits[3])
|
||||||
|
@ -141,8 +141,10 @@ class sql_db
|
||||||
$this->query_result = @mssql_query($query, $this->db_connect_id);
|
$this->query_result = @mssql_query($query, $this->db_connect_id);
|
||||||
mssql_query("SET ROWCOUNT 0");
|
mssql_query("SET ROWCOUNT 0");
|
||||||
|
|
||||||
$this->query_limit_success[$query_id] = true;
|
$this->query_limit_success[$this->query_result] = true;
|
||||||
|
|
||||||
|
$this->query_limit_offset[$this->query_result] = -1;
|
||||||
|
$this->query_limit_numrows[$this->query_result] = $num_rows;
|
||||||
if($this->query_result && $row_offset>0)
|
if($this->query_result && $row_offset>0)
|
||||||
{
|
{
|
||||||
$result = @mssql_data_seek($this->query_result, $row_offset);
|
$result = @mssql_data_seek($this->query_result, $row_offset);
|
||||||
|
@ -151,7 +153,6 @@ class sql_db
|
||||||
$this->query_limit_success[$query_id] = false;
|
$this->query_limit_success[$query_id] = false;
|
||||||
}
|
}
|
||||||
$this->query_limit_offset[$this->query_result] = $row_offset;
|
$this->query_limit_offset[$this->query_result] = $row_offset;
|
||||||
$this->query_limit_numrows[$this->query_result] = $num_rows;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(eregi("^INSERT ", $query))
|
else if(eregi("^INSERT ", $query))
|
||||||
|
@ -297,11 +298,9 @@ class sql_db
|
||||||
if($this->query_limit_success[$query_id])
|
if($this->query_limit_success[$query_id])
|
||||||
{
|
{
|
||||||
empty($this->rowset);
|
empty($this->rowset);
|
||||||
$i = 0;
|
while($this->rowset = mssql_fetch_array($query_id))
|
||||||
while($this->rowset = @mssql_fetch_array($query_id) && $i < $this->query_limit_numrows[$query_id])
|
|
||||||
{
|
{
|
||||||
$result[] = $this->rowset;
|
$result[] = $this->rowset;
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->query_limit_numrows[$query_id] == -1)
|
else if($this->query_limit_numrows[$query_id] == -1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue