SELECT sum(a.total_attendees) as s, c.data_text as t_num FROM event_registration a LEFT JOIN publisher_entry b ON a.event_id = b.ID LEFT JOIN publisher_entry_data c ON c.publisher_entry_id = b.ID where c.publisher_field_id = 25 AND b.pagename = 'home' GROUP BY a.event_id