diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-22 17:30:20 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-22 17:30:20 +0000 |
commit | 1e2ed1bc9f8128d4d252c6761b50216d0b01998e (patch) | |
tree | a0f77cfde33df5debf9cc45a1444a8df5135f0fb /phpBB/includes/search/fulltext_mysql.php | |
parent | 02239880a55f38828b1f4151fc2d2a658312b98e (diff) | |
download | forums-1e2ed1bc9f8128d4d252c6761b50216d0b01998e.tar forums-1e2ed1bc9f8128d4d252c6761b50216d0b01998e.tar.gz forums-1e2ed1bc9f8128d4d252c6761b50216d0b01998e.tar.bz2 forums-1e2ed1bc9f8128d4d252c6761b50216d0b01998e.tar.xz forums-1e2ed1bc9f8128d4d252c6761b50216d0b01998e.zip |
adjusting sql_freeresult a bit as well as our error handler (it now prints out if it is because of DEBUG_EXTRA being defined - which is not enabled within the betas/rc's and stable releases).
git-svn-id: file:///svn/phpbb/trunk@5699 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/search/fulltext_mysql.php')
-rw-r--r-- | phpBB/includes/search/fulltext_mysql.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index bfdc61a9c6..3ef8fe0b2d 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -376,12 +376,13 @@ class fulltext_mysql extends search_backend { $sql = 'SELECT FOUND_ROWS() as result_count'; $result = $db->sql_query($sql); + $result_count = (int) $db->sql_fetchfield('result_count'); + $db->sql_freeresult($result); - if (!($result_count = (int) $db->sql_fetchfield('result_count', 0, $result))) + if (!$result_count) { return false; } - $db->sql_freeresult($result); } // store the ids, from start on then delete anything that isn't on the current page because we only need ids for one page @@ -519,12 +520,13 @@ class fulltext_mysql extends search_backend { $sql = 'SELECT FOUND_ROWS() as result_count'; $result = $db->sql_query($sql); + $result_count = (int) $db->sql_fetchfield('result_count'); + $db->sql_freeresult($result); - if (!($result_count = (int) $db->sql_fetchfield('result_count', 0, $result))) + if (!$result_count) { return false; } - $db->sql_freeresult($result); } if (sizeof($id_ary)) @@ -724,10 +726,10 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $sql = 'SELECT COUNT(*) as total_posts + $sql = 'SELECT COUNT(post_id) as total_posts FROM ' . POSTS_TABLE; $result = $db->sql_query($sql); - $this->stats['total_posts'] = $db->sql_fetchfield('total_posts', 0, $result); + $this->stats['total_posts'] = (int) $db->sql_fetchfield('total_posts'); $db->sql_freeresult($result); } } |