-
Improvement
-
Resolution: Fixed
-
Trivial
-
3.0.7-PL1
-
None
In includes/acp/acp_users.php there is this query (twice).
// Generate content for all modes
|
$sql = 'SELECT u.*, s.*
|
FROM ' . USERS_TABLE . ' u
|
LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id)
|
WHERE u.user_id = ' . $user_id . '
|
ORDER BY s.session_time DESC';
|
$result = $db->sql_query($sql);
|
$user_row = $db->sql_fetchrow($result);
|
$db->sql_freeresult($result);
|
Note that only row is being fetched.
If it is guaranteed that only one row matches the query criteria, the ORDER BY can be omitted.
If there can be more than one row, $db->sql_query_limit($sql, 1); can be used.