aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-03-19 00:43:19 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-03-19 00:43:19 +0000
commit6e445f4ca5b2915274d00ef76783bd34e50756f7 (patch)
tree7cda9b03484e9a2296b51a3a6d5f35bdcb707bb3
parent71239837f7f023ece30350ebc7b2770008021606 (diff)
downloadforums-6e445f4ca5b2915274d00ef76783bd34e50756f7.tar
forums-6e445f4ca5b2915274d00ef76783bd34e50756f7.tar.gz
forums-6e445f4ca5b2915274d00ef76783bd34e50756f7.tar.bz2
forums-6e445f4ca5b2915274d00ef76783bd34e50756f7.tar.xz
forums-6e445f4ca5b2915274d00ef76783bd34e50756f7.zip
Minor rewrite of some sql fetchrow stuff
git-svn-id: file:///svn/phpbb/trunk@2334 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/viewtopic.php28
1 files changed, 22 insertions, 6 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 995bf01a61..66b8c2f45f 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -403,26 +403,42 @@ $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website,
AND u.user_id = p.poster_id
ORDER BY p.post_time $post_time_order
LIMIT $start, ".$board_config['posts_per_page'];
-if(!$result = $db->sql_query($sql))
+if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain post/user information.", "", __LINE__, __FILE__, $sql);
}
-if(!$total_posts = $db->sql_numrows($result))
+if ( $row = $db->sql_fetchrow($result) )
+{
+ $postrow = array();
+ do
+ {
+ $postrow[] = $row;
+ }
+ while ( $row = $db->sql_fetchrow($result) );
+ $db->sql_freeresult($result);
+
+ $total_posts = count($postrow);
+}
+else
{
message_die(GENERAL_MESSAGE, $lang['No_posts_topic']);
}
-$postrow = $db->sql_fetchrowset($result);
-$db->sql_freeresult($result);
$sql = "SELECT *
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
-if( !($result = $db->sql_query($sql)) )
+if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain ranks information.", "", __LINE__, __FILE__, $sql);
}
-$ranksrow = $db->sql_fetchrowset($result);
+
+$ranksrow = array();
+while ( $row = $db->sql_fetchrow($result) )
+{
+ $ranksrow[] = $row;
+}
+$db->sql_freeresult($result);
//
// Define censored word matches