#1746 get_user_avatar uses 3 queries when one is only needed

All_versions
closed-fixed
9
2004-11-16
2004-11-16
No

The following code in tikilib.php->get_user_avatar:
--------
if (!$userlib->user_exists($user)) {
return '';
}
$type = $userlib->get_user_details('avatarType', $user);
$libname = $userlib->get_user_details('avatarLibName',
$user);
---------
shows that 3 queries are made. The code could be
reorganised around one query only as all the data
needed is stored in the users_users table.

"SELECT login,avatarType,avatarLibName FROM users_users
where login='$user';"

This function is in use in lots of places...

Discussion

  • Franck Martin

    Franck Martin - 2004-11-16
    • summary: get_user_avatar use 3 queries when on is only needed --> get_user_avatar uses 3 queries when one is only needed
     
  • Franck Martin

    Franck Martin - 2004-11-16
    • assigned_to: nobody --> franck
    • status: open --> closed-fixed
     

Log in to post a comment.