You are viewing a plain text version of this content. The canonical link for it is here.
Posted to olio-dev@incubator.apache.org by "Akara Sucharitakul (JIRA)" <ji...@apache.org> on 2009/01/14 05:00:59 UTC

[jira] Resolved: (OLIO-15) SQL to count friends in friends.php overly complex

     [ https://issues.apache.org/jira/browse/OLIO-15?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Akara Sucharitakul resolved OLIO-15.
------------------------------------

    Resolution: Fixed

Fixed by check in version 734327 inadvertently checked in for issue OLIO-31.

> SQL to count friends in friends.php overly complex
> --------------------------------------------------
>
>                 Key: OLIO-15
>                 URL: https://issues.apache.org/jira/browse/OLIO-15
>             Project: Olio
>          Issue Type: Bug
>          Components: php-app
>            Reporter: Nick Lanham
>            Assignee: Akara Sucharitakul
>            Priority: Minor
>          Time Spent: 0.33h
>  Remaining Estimate: 0h
>
> In public_html/friends.php:60 there's the following query:
> $query = "select count(*) as count from PERSON as p, PERSON_PERSON as pp where pp.person_username='$user' and p.username=pp.friends_username and pp.is_accepted=1";
> This simply counts the # of friends you have and could just as well be written as:
> $query = "select count(*) as count from PERSON_PERSON as pp where pp.person_username='$user' and pp.is_accepted=1";
> The only difference here would be if a person got deleted from the PERSON table but not from the PERSON_PERSON table which should never happen.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.