what;s wrong with this mysql trigger logically??
DELIMITER |
CREATE TRIGGER comment_count AFTER INSERT ON comments
FOR EACH ROW
BEGIN
UPDATE sub_sections as t1 SET t1.published_comment_count = (select count(id) as cnt from comments where article_id=t1.id and published=0 and status=0)
WHERE id= (select article_id from comments order by date_modified desc limit 0,1 );
END;
DELIMITER ;