aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFyorl <gaelreth@gmail.com>2012-08-04 15:44:10 +0100
committerFyorl <gaelreth@gmail.com>2012-08-04 15:47:22 +0100
commitaa87258cc6503f4c9b2f64a69614b4e5f2a21da5 (patch)
tree0d9111f89cccb9ffd6f3f790764da17a39b4eae3
parent16ec660e769360a8cd7063ea083487486051101f (diff)
downloadforums-aa87258cc6503f4c9b2f64a69614b4e5f2a21da5.tar
forums-aa87258cc6503f4c9b2f64a69614b4e5f2a21da5.tar.gz
forums-aa87258cc6503f4c9b2f64a69614b4e5f2a21da5.tar.bz2
forums-aa87258cc6503f4c9b2f64a69614b4e5f2a21da5.tar.xz
forums-aa87258cc6503f4c9b2f64a69614b4e5f2a21da5.zip
[feature/attach-dl] Used sql_fetchrowset
PHPBB3-11042
-rw-r--r--phpBB/download/file.php25
1 files changed, 6 insertions, 19 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 6dfa1d7297..28a89b2374 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -190,13 +190,9 @@ if ($topic_id)
WHERE p.topic_id = $topic_id
AND p.post_attachment = 1
AND a.post_msg_id = p.post_id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $attachments[] = $row;
- }
+ $result = $db->sql_query($sql);
+ $attachments = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
}
@@ -205,13 +201,9 @@ if ($post_id)
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
FROM ' . ATTACHMENTS_TABLE . "
WHERE post_msg_id = $post_id";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $attachments[] = $row;
- }
+ $result = $db->sql_query($sql);
+ $attachments = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
}
@@ -374,14 +366,9 @@ if ($attachments)
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filesize, filetime
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('attach_id', $attach_ids);
- $result = $db->sql_query($sql);
- $attachments = array();
-
- while ($row = $db->sql_fetchrow($result))
- {
- $attachments[] = $row;
- }
+ $result = $db->sql_query($sql);
+ $attachments = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
}