rallokkcaz Posted May 6, 2007 Share Posted May 6, 2007 i currently have a news system, and want to allow people to add comments on what they think about the article. would i have to add another table, or another row into my database. any help? Thanks Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/ Share on other sites More sharing options...
suttercain Posted May 6, 2007 Share Posted May 6, 2007 last time I tried to help you said you didn't have time and ran off... think that was Thursday... Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246840 Share on other sites More sharing options...
rallokkcaz Posted May 6, 2007 Author Share Posted May 6, 2007 i had to go man it was 2 am and i had school sorry Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246841 Share on other sites More sharing options...
suttercain Posted May 6, 2007 Share Posted May 6, 2007 but did you every go back to that previous post and get help? Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246847 Share on other sites More sharing options...
rallokkcaz Posted May 6, 2007 Author Share Posted May 6, 2007 yup, i had the LIMIT part in the wrong place and got it too work. and can someone answer my question? Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246849 Share on other sites More sharing options...
suttercain Posted May 6, 2007 Share Posted May 6, 2007 How is your news table set up now? I would would make a new table and use a foreign key for your newid column. Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246853 Share on other sites More sharing options...
hackerkts Posted May 6, 2007 Share Posted May 6, 2007 If I were you, I could create a new table, and have a id column to display those name accordingly. Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246856 Share on other sites More sharing options...
rallokkcaz Posted May 6, 2007 Author Share Posted May 6, 2007 k its got id user content topic time Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246858 Share on other sites More sharing options...
suttercain Posted May 6, 2007 Share Posted May 6, 2007 I am assuming that is for your comment table? If so you need to have it attached to your news table... newsid (or what ever title you use). That way it knows which news story they user is commenting on. Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246860 Share on other sites More sharing options...
rallokkcaz Posted May 6, 2007 Author Share Posted May 6, 2007 I am assuming that is for your comment table? If so you need to have it attached to your news table... newsid (or what ever title you use). That way it knows which news story they user is commenting on. no thats for my news table so how exactly would i use a foreign key? Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246865 Share on other sites More sharing options...
suttercain Posted May 6, 2007 Share Posted May 6, 2007 As far as using foreign keys, I have only done it once after trail and error, but this is a good resource: http://dev.mysql.com/doc/refman/5.0/en/example-foreign-keys.html But you would want your tables to look like this: NEWS TABLE: * id * user * content * topic * time COMMENT TABLE *comment *user * id (foreign key) //This is a way to post the comment only on that news page *commentId * timeDate This help? Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246867 Share on other sites More sharing options...
rallokkcaz Posted May 6, 2007 Author Share Posted May 6, 2007 so how exactly would the foreign key be coded into mysql?? Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246881 Share on other sites More sharing options...
rallokkcaz Posted May 6, 2007 Author Share Posted May 6, 2007 anyone? Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246895 Share on other sites More sharing options...
rallokkcaz Posted May 7, 2007 Author Share Posted May 7, 2007 foreign key anyone!?!?!?!?!? ???????? Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246908 Share on other sites More sharing options...
trq Posted May 7, 2007 Share Posted May 7, 2007 Please refrain form bumping your thread every 5 minutes. Its against our forum guidelines and just plain rude if you ask me. Real poor form. I suggest you read this tutorial on normalization. Link to comment https://forums.phpfreaks.com/topic/50288-how-to-make-a-comment-system/#findComment-246913 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.