View Full Version : PHP comments?

02-09-2006, 03:37 AM
Ok, i need some help.. i have a comment script (www.visionstudios.be/test.php) now whenever you comment, it shows the comment likes its suppose to. it uses 2 includes on to display, the comment form, and another for displaying the comments, except i wanna have comments on lots of differant pages like on every tutorial page user should be able to comment, so how do i make it do this;
you comment on tutorial 1
it displays commenst for only tutorial 1, and not tutorial 2!
you comment on tutorial 2
it displays comments for only tutorial 2, and not tutorial 1!

right now it displays comments for both. www.visionstudios.be/test4.php should only display comments that are commented from that page, not from www.visionstudios.be/test.php.

how do i do this? thanks. -cnelson.

02-09-2006, 04:37 PM
we need more info.

normally you'll have a commentstable and a tutorials table. when inserting a record in the commentstable, then you'll add a value inside a column like tutorialID. This column should the contain the PK value of the record from the tutorials-table to which you wanna link the comment (this is called a PK-FK relationship).
or you could have 3 tables: comments-table, tutorials-table and a factstable that contains the references to your comments and tutorials table. (this would be the best design if a coment can apply to more then one tutorial)

02-09-2006, 07:38 PM
i found out how=] thank you. -cnelson. :)