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 Quote Link to comment 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... Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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?? Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted May 6, 2007 Author Share Posted May 6, 2007 anyone? Quote Link to comment Share on other sites More sharing options...
rallokkcaz Posted May 7, 2007 Author Share Posted May 7, 2007 foreign key anyone!?!?!?!?!? ???????? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.