You will get useful hints for developing your application with Zend Framework
MYSQL - LEFT JOIN query
SELECT U.username, U.user_id, SR.section_id, U.access, count( DISTINCT SR.section_id ) AS section_count FROM `users` U LEFT JOIN `survey_replies` SR ON ( U.user_id = SR.user_id ) WHERE U.access >1 GROUP BY U.user_id ORDER BY SR.section_id