1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-13 20:28:44 +01:00

Minor rewrite of some sql fetchrow stuff

git-svn-id: file:///svn/phpbb/trunk@2334 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-03-19 00:43:19 +00:00
parent 71239837f7
commit 6e445f4ca5

View File

@ -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