mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 23:37:39 +02: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:
@@ -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
|
AND u.user_id = p.poster_id
|
||||||
ORDER BY p.post_time $post_time_order
|
ORDER BY p.post_time $post_time_order
|
||||||
LIMIT $start, ".$board_config['posts_per_page'];
|
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);
|
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']);
|
message_die(GENERAL_MESSAGE, $lang['No_posts_topic']);
|
||||||
}
|
}
|
||||||
$postrow = $db->sql_fetchrowset($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM " . RANKS_TABLE . "
|
FROM " . RANKS_TABLE . "
|
||||||
ORDER BY rank_special, rank_min";
|
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);
|
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
|
// Define censored word matches
|
||||||
|
Reference in New Issue
Block a user