Hi

I plan to set up "reader comments" on my pages, and have a little book called something like "PHP in easy steps" that has an example.

One thing I am not sure of is, once a comment has been published, can it simply be modified by finding the item on the database and changing it / deleting it?

I guess ideally each comment should be moderated before being published, but that seems to be more complicated for me right now.

Also, is it easy (ish) to set up comments on many pages? e.g. I have about 100 "articles" pages that I would like to add comments to. Can this be set up automatically, with a simple bit of code, or woul each page have to be linked to the database?

I really am a newbie! Look forward to your advice.

Oh, I am starting to think that I should get a better book on php / MySQL etc. If anyone can recommend one (that is available in the UK) that would be great.

Cheers,

Jon.

    you do sound like a noob. databases can slice/dice/juggle/sort your data however you want. the devil is in the details.

    try doing some tutorials...mysql for dummies or php for dummies would be good to get you started.

      Figure out what you want to do first, then write it down. Don't code off the cuff because if you don't design properly up front, you will be wasting time going back and forth in revisions. Sit down and take the time to write down what you want in the comments module for both the administrator and the user. From a big picture perspective, the comments module is really only a small part of what you are trying to accomplish, if I am reading this right.

      You will definitely want moderation done on comments as rogue users who spam your blog/website will come into play. You obviously need a means to edit/remove comments and a administration module to view comments in a paged list. You also will need a comment form, just like the quick reply box here in Phpbuilder to submit to the queue (or post directly).

      All comments get sent to a queue for approval so the admin can moderate them. This means you need a way to administer and register different types of users. You can of course turn this off but you are trusting the individual anonymously or need to have a user module that grants priviledges to certain types of users who have registered.

      Obviously, you need a means to store users and comments (even articles/entries) and that requires a database or flat file implementation. You will need to learn about database development too, not just PHP.

      My suggestion is to use a content management system (CMS) or existing blog software. Google search "php cms" and you will find plenty of free scripts. In other words, why reinvent the wheel?

        To the point:

        Your message structure will need to have at least one item for each of the tasks you are talking about:

        Article number
        (number is best, you can do this other ways, but number are best for future use)

        Possible user number
        (this is helpful if you start having user login, or want to be able to delete all the spam that is going to hit yoursite once you open up a form comment system)

        comment number
        (the number of the actual comment, so you can add delete modify it in the future)

        article address might be handy
        (this is assumeing that you are attemping to integrate this into a "static" or non-database drive site you already have.

        So then you need multiple tables, the reason for this is that you are going to be creating "one to many" relations ships. Many comments, to one article, or one user.

        It is a lot of fun to do database stuff, and if you are just getting your feet wet then I disagree with the above post, and say go for it! However, if you are in a hurry, then just use a CMS like Joomla or Drupal, or a thousand others. (content management system)

        When I was getting started sometimes I would download apps that did similar tasks, and look at their data structures for ideas.

        Good luck, get some more books, but nothing with idiot or dummy in the title, it is bad for moral,

        -- Will

          Write a Reply...