View Single Post
Old 07-31-2008, 11:28 AM   #9 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Location: On your Hard Drive, hiding like a Virus
Posts: 888
Thanks: 168
Orc is on a distinguished road
Default

sql Code:
SELECT
            t.tid,
            t.title AS thread_title,
            t.created,
            t.mid,
            t.fid,
            f.title AS forum_title,
            f.DESC  AS forum_desc,
            f.created AS forum_timestamp,
            fc.title AS fc_title,
            m.username AS member_username,
            m.mid AS member_uid,
            p.created AS post_time,
            p.msg AS post_msg,
            m.signature AS member_signature,
            p.pid,
            r.rid,
            COUNT(DISTINCT r.rid) AS rating_count
            FROM `threads` AS t
           
            LEFT JOIN `posts` AS p ON p.tid=t.tid
            LEFT JOIN `forums` AS f ON f.fid=t.fid
            LEFT JOIN `forum_categories` AS fc ON f.catid=fc.fcid
            LEFT JOIN `members` AS m ON m.mid=p.mid
            LEFT JOIN `member_ratings` AS r ON r.pid=p.pid
           
           
       
           
           
            WHERE t.tid = '".$tid."'
            AND   f.fid = '".$fid."'
           
            GROUP BY p.pid
            ORDER BY p.pid

I only get 1 row from member_ratings
__________________
Wax on, Wax off
Orc is offline  
Reply With Quote