Hi, I'm encountering a serious problem, at least for me, whether which the method should I use. Say, I have a user login system website that allows members to leave comment on their friends' profile and photo. The question is, should I store comment content separately between profile comment and photo comment, or should I store them together in a pool table. As in a trail phase, daily user comment is very huge volume for both kind of them. In the long run, which method is the best. I have no idea about this because it's is my first website of a kind. Thanks Ket
I would keep all comments in one table. All you would need to do then is have a column for each id type (profile_id, photo_id). If the comment is for a photo (whos id is 1000) then profile_id=null and photo_id=1000. To get all the comments for the photo 1000, you would just query the comments table where photo_id=1000. Piece of cake!Â
well if you keep comments seperate its good for management.. if you cant keep them then make two more fileds. cmm_type 1 for photo 2 for profile. and then UID for that photo or post. while fetching fetch it as ... select * from comments where uid=' UID_here' and cmm_type = '1' limit 0,100; correct my sql query as i am writing for your info...