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;
|
||||
|
||||
$sql_array = array(
|
||||
'SELECT' => 'u.user_style',
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
),
|
||||
'WHERE' => 'u.user_id = ' . ANONYMOUS,
|
||||
);
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||
$sql = 'SELECT u.user_style
|
||||
FROM ' . USERS_TABLE . ' u
|
||||
WHERE u.user_id = ' . ANONYMOUS;
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$style = (isset($row['user_style'])) ? $row['user_style'] : false;
|
||||
}
|
||||
$style = (int) $db->sql_fetchfield('user_style');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return $style;
|
||||
}
|
||||
|
@ -961,7 +953,7 @@ class acp_board
|
|||
);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
SET user_style = ' . $style_id . '
|
||||
WHERE user_id = ' . ANONYMOUS;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue