hi , how to display the users for that project in index page. I have created a new table called User project and wanted to display for that user in the index page for that project. Since its throwing an syntax error in mysql. Where its not taking the userid , but in the session its accepting userid, but with syntax error. Please help me.
select project_name as "Project", sum(case when resolution_id = 0 then 1 else 0 end) as "Open", sum(case when resolution_id = 1 then 1 else 0 end) as "Fixed", sum(case when resolution_id = 3 then 1 else 0 end) as "Won't Fix", sum(case when resolution_id = 4 then 1 else 0 end) as "Deferred", sum(case when resolution_id = 5 then 1 else 0 end) as "Works for me", sum(case when resolution_id = 6 then 1 else 0 end) as "Duplicate", count(bug_id) as "Total" from bt_bug b left join bt_user_project up on up.project_id = b.project_id left join bt_project p on up.project_id = p.project_id left join bt_auth_user au on up.user_id = au.user_id where b.project_id not in (0,2) and au.user_id = and p.active = 1 group by p.project_id, p.project_name order by project_name [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and p.active = 1 group by p.project_id, p.project_name order by project_name' at line 1]

attached is the query error. 'index-projsummary-6' =>
        '%s, count(bug_id) as "Total" '.
        'from '.
        TBL_BUG.' b '.
        'left join '.TBL_USER_PROJECT.' up on up.project_id = b.project_id  '.
        'left join '.TBL_PROJECT.' p on up.project_id = p.project_id  '.
        'left join '.TBL_AUTH_USER.' au on up.user_id = au.user_id  '.
        'where '.
            'b.project_id not in (%s) '.
            'and au.user_id = '.$_SESSION['uid'].' '.
            'and p.active = 1 '.
        'group by '.
              'p.project_id, p.project_name '.
        'order by project_name ',
is the query i have written. Please help me.