mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 09:16:55 +02:00
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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -1015,13 +1015,13 @@ class fulltext_phpbb extends search_backend
|
||||
$sql = 'SELECT COUNT(*) as total_words
|
||||
FROM ' . SEARCH_WORD_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$this->stats['total_words'] = $db->sql_fetchfield('total_words', 0, $result);
|
||||
$this->stats['total_words'] = (int) $db->sql_fetchfield('total_words');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT COUNT(*) as total_matches
|
||||
FROM ' . SEARCH_MATCH_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$this->stats['total_matches'] = $db->sql_fetchfield('total_matches', 0, $result);
|
||||
$this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches');
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user