I have three datatables: comment, blog and user. I don't know much about Triggers in MySql, but is it possible to sum up the counts of every Row in comment and blog when a new Row is inserted or deleted?
E.g. blog has 3 entries and comment has 5 entries. When I delete one comment now, it should update the record 'post' in user to 7 by counting the entries in blog and comment by the username.
comment table rows: id | cdate | edate | author | email |status | content | url | bid | level
blog table rows: id | cid | author | cdate | title | teaser | content | url
user table rows: id | username | email | pass | posts
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…