Hi i have tables like this :
table entry :
id | total_comments _____________________ 1 | 0 2 | 0 3 | 0 4 | 0
If you really need total_comments in a separate table, I would make that a VIEW.
CREATE VIEW entry AS SELECT id, COUNT(comments) AS total_comment FROM comments GROUP BY id
This way you avoid the maintenance task of updating the total_comments table altogether.