Hi
Im trying to pull out a list of meetings, and the associated number of comments attached to each meeting. Comments are assigned a category (ie meetings) and a linkid (the uniqe id of the meeting) - Im using this query, buts its cutting out all meetings that don't have any comments attached, and Ive hit a mental block... how do I pull out all meetings (and a value of zero if there are no comments?!)
$sql = "SELECT m.id,m.title, m.blurb, m.mktime, m.start, m.stop, u.name AS first, u.surname, v.name AS venue, COUNT(c.id) as comment_count FROM meetings AS m
LEFT JOIN users As u ON u.id = m.userid
LEFT JOIN venues AS v ON v.id = m.venueid
LEFT JOIN comments AS c ON c.linkid = m.id
WHERE c.category = 'meetings'
ORDER BY m.mktime ASC";