diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-08-07 00:31:18 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-08-07 00:31:18 +0200 |
commit | 862502aacd36918ba9c9d5524e625c02a3830897 (patch) | |
tree | 732fe968e921662a2cdf79d5a6b139b97901f2fd /phpBB/download/file.php | |
parent | 2d32164fb074e12f12a38cc41f424611551d9573 (diff) | |
download | forums-862502aacd36918ba9c9d5524e625c02a3830897.tar forums-862502aacd36918ba9c9d5524e625c02a3830897.tar.gz forums-862502aacd36918ba9c9d5524e625c02a3830897.tar.bz2 forums-862502aacd36918ba9c9d5524e625c02a3830897.tar.xz forums-862502aacd36918ba9c9d5524e625c02a3830897.zip |
[feature/attach-dl] Use table aliases in all three cases.
PHPBB3-11042
Diffstat (limited to 'phpBB/download/file.php')
-rw-r--r-- | phpBB/download/file.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php index f540869a1e..bd96ad02f7 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -164,18 +164,18 @@ $attachments = ($topic_id || $post_id) ? array() : false; // $download_id, $post_id, $topic_id if ($download_id) { - $sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime - FROM ' . ATTACHMENTS_TABLE . " - WHERE attach_id = $download_id"; + $sql = 'SELECT a.attach_id, a.in_message, a.post_msg_id, a.extension, a.is_orphan, a.poster_id, a.filetime + FROM ' . ATTACHMENTS_TABLE . " a + WHERE a.attach_id = $download_id"; $result = $db->sql_query($sql); $attachment = $db->sql_fetchrow($result); $db->sql_freeresult($result); } else 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"; + $sql = 'SELECT a.attach_id, a.in_message, a.post_msg_id, a.extension, a.is_orphan, a.poster_id, a.filetime + FROM ' . ATTACHMENTS_TABLE . " a + WHERE a.post_msg_id = $post_id"; $result = $db->sql_query($sql); $attachments = $db->sql_fetchrowset($result); |