If you've written your own commenting script or did it following a tutorial, you may have already experienced problems with flood (several comments by the same person). This can lead to problems if the comments are added too fast, since it can slow down the MySQL and even lead to internal server errors.

There's a very simple way to prevent this: we will check if any of the previous comments were done from the same IP and check when they were done, if it's been less than X minutes, it will display a message, if it's been more than X minutes, it will insert the comment normally.

First check if your comments table has an ip field, if it doesn't, you will need to add it. Log in to your PHPMyAdmin and open your comments table, run this query:

ALTER TABLE table ADD ip VARCHAR(20);

Now into the coding. Remember you must combine this with your commenting script.

That's all. I know this tutorial may be confusing, so feel free to ask at the forum and I'll try to make it clearer.

Note: this method will not work with some bots, because they change IP everytime they make a post, so a solution would be not checking the IP, but only add the comment if the last one (by anyone, from any IP) was added more than X minutes ago.