mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
- finally removed sql_numrows
- sql_fetchfield now in dbal.php - check query id correctly as well as other tiny fixes git-svn-id: file:///svn/phpbb/trunk@6439 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -202,27 +202,6 @@ class dbal_mssql extends dbal
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of rows
|
||||
* Not used within core code
|
||||
*/
|
||||
function sql_numrows($query_id = false)
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
{
|
||||
return $cache->sql_numrows($query_id);
|
||||
}
|
||||
|
||||
return ($query_id) ? @mssql_num_rows($query_id) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of affected rows
|
||||
*/
|
||||
@@ -238,7 +217,7 @@ class dbal_mssql extends dbal
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (!$query_id)
|
||||
if ($query_id === false)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
@@ -248,6 +227,11 @@ class dbal_mssql extends dbal
|
||||
return $cache->sql_fetchrow($query_id);
|
||||
}
|
||||
|
||||
if ($query_id === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$row = @mssql_fetch_assoc($query_id);
|
||||
|
||||
// I hope i am able to remove this later... hopefully only a PHP or MSSQL bug
|
||||
@@ -262,38 +246,6 @@ class dbal_mssql extends dbal
|
||||
return $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch field
|
||||
* if rownum is false, the current row is used, else it is pointing to the row (zero-based)
|
||||
*/
|
||||
function sql_fetchfield($field, $rownum = false, $query_id = false)
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (!$query_id)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
||||
if ($query_id)
|
||||
{
|
||||
if ($rownum !== false)
|
||||
{
|
||||
$this->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
|
||||
if (isset($cache->sql_rowset[$query_id]))
|
||||
{
|
||||
return $cache->sql_fetchfield($query_id, $field);
|
||||
}
|
||||
|
||||
$row = $this->sql_fetchrow($query_id);
|
||||
return isset($row[$field]) ? $row[$field] : false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek to given row number
|
||||
* rownum is zero-based
|
||||
@@ -302,7 +254,7 @@ class dbal_mssql extends dbal
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (!$query_id)
|
||||
if ($query_id === false)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
@@ -312,7 +264,7 @@ class dbal_mssql extends dbal
|
||||
return $cache->sql_rowseek($rownum, $query_id);
|
||||
}
|
||||
|
||||
return ($query_id) ? @mssql_data_seek($query_id, $rownum) : false;
|
||||
return ($query_id !== false) ? @mssql_data_seek($query_id, $rownum) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -341,7 +293,7 @@ class dbal_mssql extends dbal
|
||||
{
|
||||
global $cache;
|
||||
|
||||
if (!$query_id)
|
||||
if ($query_id === false)
|
||||
{
|
||||
$query_id = $this->query_result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user