Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: PHP comments?

  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP comments?

    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.

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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)
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New Coder
    Join Date
    Feb 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i found out how=] thank you. -cnelson.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •