Page 1 of 1

How to solve this? Commentary subscription

Posted: Wed Jan 27, 2010 1:47 pm
by JKM
Hi there,

I'm having a small page with ~30 users, and I'm using the same MySQL-table for a comment system I made. The field 'type' indicates if it's a picture, movie or what, and the field 'parents' indicates the picture/movie id. But I want some a subscription feature (notification on new comments). It should send an email to the users that's checked the 'subscribe' checkbox. So I'm thinking about making another table for subscription list, but I'm not sure how I should do it. Any ideas?

Re: How to solve this? Commentary subscription

Posted: Wed Jan 27, 2010 2:01 pm
by AbraCadaver
That sounds right. A subscriptions table with the user_id and the comment_id. When someone subscribes you just insert the user_id and comment_id. When a new comment is posted query the table and select all user_ids where comment_id equals the current comment and join on the users table to get the email addresses. Then pass the addresses off to a routine that emails the notice.

Re: How to solve this? Commentary subscription

Posted: Wed Jan 27, 2010 3:58 pm
by JKM
AbraCadaver wrote:That sounds right. A subscriptions table with the user_id and the comment_id. When someone subscribes you just insert the user_id and comment_id. When a new comment is posted query the table and select all user_ids where comment_id equals the current comment and join on the users table to get the email addresses. Then pass the addresses off to a routine that emails the notice.
Hmm, let me try.

Thanks!