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?

 

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?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.