aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/mysql.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-10-04 15:15:40 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-10-04 15:15:40 +0000
commit26aba1a1f170ac51a56fe86bbc19588e0efee3c3 (patch)
treea92878b658c325297e5054d5622d642934b189df /phpBB/includes/db/mysql.php
parentf7f6e9bcde7a1508109146f462d4627a484eb594 (diff)
downloadforums-26aba1a1f170ac51a56fe86bbc19588e0efee3c3.tar
forums-26aba1a1f170ac51a56fe86bbc19588e0efee3c3.tar.gz
forums-26aba1a1f170ac51a56fe86bbc19588e0efee3c3.tar.bz2
forums-26aba1a1f170ac51a56fe86bbc19588e0efee3c3.tar.xz
forums-26aba1a1f170ac51a56fe86bbc19588e0efee3c3.zip
- 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
Diffstat (limited to 'phpBB/includes/db/mysql.php')
-rw-r--r--phpBB/includes/db/mysql.php71
1 files changed, 5 insertions, 66 deletions
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 63cc9fe98c..de92fd679f 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -194,27 +194,6 @@ class dbal_mysql 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) ? @mysql_num_rows($query_id) : false;
- }
-
- /**
* Return number of affected rows
*/
function sql_affectedrows()
@@ -229,7 +208,7 @@ class dbal_mysql extends dbal
{
global $cache;
- if (!$query_id)
+ if ($query_id === false)
{
$query_id = $this->query_result;
}
@@ -239,47 +218,7 @@ class dbal_mysql extends dbal
return $cache->sql_fetchrow($query_id);
}
- return ($query_id) ? @mysql_fetch_assoc($query_id) : 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)
- {
- $query_id = $this->query_result;
- }
-
- if ($query_id)
- {
- if ($rownum === false)
- {
- 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;
- }
- else
- {
- if (isset($cache->sql_rowset[$query_id]))
- {
- $cache->sql_rowseek($rownum, $query_id);
- return $cache->sql_fetchfield($query_id, $field);
- }
-
- return @mysql_result($query_id, $rownum, $field);
- }
- }
-
- return false;
+ return ($query_id !== false) ? @mysql_fetch_assoc($query_id) : false;
}
/**
@@ -290,7 +229,7 @@ class dbal_mysql extends dbal
{
global $cache;
- if (!$query_id)
+ if ($query_id === false)
{
$query_id = $this->query_result;
}
@@ -300,7 +239,7 @@ class dbal_mysql extends dbal
return $cache->sql_rowseek($rownum, $query_id);
}
- return ($query_id) ? @mysql_data_seek($query_id, $rownum) : false;
+ return ($query_id !== false) ? @mysql_data_seek($query_id, $rownum) : false;
}
/**
@@ -318,7 +257,7 @@ class dbal_mysql extends dbal
{
global $cache;
- if (!$query_id)
+ if ($query_id === false)
{
$query_id = $this->query_result;
}