Jump to content

how to make a comment system


rallokkcaz

Recommended Posts

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
Share on other sites

 

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.