mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[feature/attach-dl] Used sql_fetchrowset
PHPBB3-11042
This commit is contained in:
parent
16ec660e76
commit
aa87258cc6
1 changed files with 6 additions and 19 deletions
|
@ -190,13 +190,9 @@ if ($topic_id)
|
||||||
WHERE p.topic_id = $topic_id
|
WHERE p.topic_id = $topic_id
|
||||||
AND p.post_attachment = 1
|
AND p.post_attachment = 1
|
||||||
AND a.post_msg_id = p.post_id";
|
AND a.post_msg_id = p.post_id";
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$attachments = $db->sql_fetchrowset($result);
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$attachments[] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->sql_freeresult($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
|
$sql = 'SELECT attach_id, in_message, post_msg_id, extension, is_orphan, poster_id, filetime
|
||||||
FROM ' . ATTACHMENTS_TABLE . "
|
FROM ' . ATTACHMENTS_TABLE . "
|
||||||
WHERE post_msg_id = $post_id";
|
WHERE post_msg_id = $post_id";
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
$attachments = $db->sql_fetchrowset($result);
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$attachments[] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->sql_freeresult($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
|
$sql = 'SELECT attach_id, is_orphan, in_message, post_msg_id, extension, physical_filename, real_filename, mimetype, filesize, filetime
|
||||||
FROM ' . ATTACHMENTS_TABLE . '
|
FROM ' . ATTACHMENTS_TABLE . '
|
||||||
WHERE ' . $db->sql_in_set('attach_id', $attach_ids);
|
WHERE ' . $db->sql_in_set('attach_id', $attach_ids);
|
||||||
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
$attachments = array();
|
$attachments = $db->sql_fetchrowset($result);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$attachments[] = $row;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue