mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
SQL optimisations
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9399 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e461162847
commit
06c4fbf81f
2 changed files with 4 additions and 4 deletions
|
@ -1120,7 +1120,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||||
$sql_update = array();
|
$sql_update = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$sql_update[] = $row['forum_id'];
|
$sql_update[] = (int) $row['forum_id'];
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
|
|
@ -898,7 +898,7 @@ $result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
||||||
$i = ($store_reverse) ? $sql_limit - 1 : 0;
|
$i = ($store_reverse) ? $sql_limit - 1 : 0;
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$post_list[$i] = $row['post_id'];
|
$post_list[$i] = (int) $row['post_id'];
|
||||||
($store_reverse) ? $i-- : $i++;
|
($store_reverse) ? $i-- : $i++;
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
@ -952,12 +952,12 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
$max_post_time = $row['post_time'];
|
$max_post_time = $row['post_time'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$poster_id = $row['poster_id'];
|
$poster_id = (int) $row['poster_id'];
|
||||||
|
|
||||||
// Does post have an attachment? If so, add it to the list
|
// Does post have an attachment? If so, add it to the list
|
||||||
if ($row['post_attachment'] && $config['allow_attachments'])
|
if ($row['post_attachment'] && $config['allow_attachments'])
|
||||||
{
|
{
|
||||||
$attach_list[] = $row['post_id'];
|
$attach_list[] = (int) $row['post_id'];
|
||||||
|
|
||||||
if ($row['post_approved'])
|
if ($row['post_approved'])
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue