mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/12408] Simplified queries
PHPBB3-12408
This commit is contained in:
parent
265c621c9e
commit
ae63843647
1 changed files with 7 additions and 15 deletions
|
@ -930,21 +930,13 @@ class acp_board
|
||||||
|
|
||||||
$style = false;
|
$style = false;
|
||||||
|
|
||||||
$sql_array = array(
|
$sql = 'SELECT u.user_style
|
||||||
'SELECT' => 'u.user_style',
|
FROM ' . USERS_TABLE . ' u
|
||||||
'FROM' => array(
|
WHERE u.user_id = ' . ANONYMOUS;
|
||||||
USERS_TABLE => 'u',
|
|
||||||
),
|
|
||||||
'WHERE' => 'u.user_id = ' . ANONYMOUS,
|
|
||||||
);
|
|
||||||
|
|
||||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
$style = (int) $db->sql_fetchfield('user_style');
|
||||||
{
|
$db->sql_freeresult($result);
|
||||||
$style = (isset($row['user_style'])) ? $row['user_style'] : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $style;
|
return $style;
|
||||||
}
|
}
|
||||||
|
@ -961,8 +953,8 @@ class acp_board
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
SET user_style = ' . $style_id . '
|
||||||
WHERE user_id = ' . ANONYMOUS;
|
WHERE user_id = ' . ANONYMOUS;
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue