1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +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:
Meik Sievertsen
2006-10-04 15:15:40 +00:00
parent f7f6e9bcde
commit 26aba1a1f1
12 changed files with 122 additions and 516 deletions

View File

@@ -110,12 +110,12 @@ class dbal
*/
function sql_fetchrowset($query_id = false)
{
if (!$query_id)
if ($query_id === false)
{
$query_id = $this->query_result;
}
if ($query_id)
if ($query_id !== false)
{
$result = array();
while ($row = $this->sql_fetchrow($query_id))
@@ -129,6 +129,38 @@ class dbal
return false;
}
/**
* 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 === false)
{
$query_id = $this->query_result;
}
if ($query_id !== false)
{
if ($rownum !== false)
{
$this->sql_rowseek($rownum, $query_id);
}
if (!is_object($query_id) && 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;
}
/**
* SQL Transaction
* @access private