Show
Ignore:
Timestamp:
10/03/08 17:44:10 (3 months ago)
Author:
anatoo
Message:

サブクエリ使ってるとこを失くした

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/plain_php/trunk/model/phwittr/FriendshipService.php

    r20338 r20609  
    1515        $count = $this->fetchFollowerCount($user_id); 
    1616         
    17         $smt = $this->pdo->prepare(' 
     17        /*$smt = $this->pdo->prepare(' 
    1818            select  
    1919                user_followers.*, 
     
    3333             )user_followings  
    3434             on user_followers.id = user_followings.follow_id 
     35            ');*/ 
     36         
     37        $smt = $this->pdo->prepare(' 
     38            select  
     39                *, 
     40                users.id as user_id 
     41            from  
     42                followers left join users  
     43                on followers.user_id = users.id 
     44            where followers.follow_id = :user_id 
     45            limit :offset, :limit 
    3546            '); 
    36          
    3747 
    3848        $smt->bindValue(':user_id', $user_id, PDO::PARAM_INT);