matt2kjones
11-29-2002, 02:44 PM
Ok im currently writting a forum, for my site in mysql, and php
i have made a user profile section, and a private messaging system, and that all works perfectly.
now there is something i would like to know before i continue.
on each forum, on these forums, you will notice it says how many topics and posts there are within that forum.
Now, this is how im thinking of adding, and deducting to that number
i am going to store the number of topics and posts in a table called forums
along with the forum_id, forum_name etc etc
now, the method im thinking of using is this one
everytime a user creates a topic, the number is retrieved from the database, 1 is added to it, and then the new number (old_number + 1) is then saved back to the table
the same method is used when a user creates a post. and the reverse happens when a user deletes a topic, or post
now, if a topic is moved, the number topic number is deducted one from the forum its going from, and added by one, to the forum its going to, and the same for the number of posts in that topic being moved.
now, that method will work. But i want to know something. Will it remain accurate if loads of people are concurrently posting???
say the maths that does it is perfect, and there is no problem with the script, it does what its mean to do. will it stay accurate in this case???
or can it still become inaccurate even though the script is adding, deducting correctly????
Thanx
i have made a user profile section, and a private messaging system, and that all works perfectly.
now there is something i would like to know before i continue.
on each forum, on these forums, you will notice it says how many topics and posts there are within that forum.
Now, this is how im thinking of adding, and deducting to that number
i am going to store the number of topics and posts in a table called forums
along with the forum_id, forum_name etc etc
now, the method im thinking of using is this one
everytime a user creates a topic, the number is retrieved from the database, 1 is added to it, and then the new number (old_number + 1) is then saved back to the table
the same method is used when a user creates a post. and the reverse happens when a user deletes a topic, or post
now, if a topic is moved, the number topic number is deducted one from the forum its going from, and added by one, to the forum its going to, and the same for the number of posts in that topic being moved.
now, that method will work. But i want to know something. Will it remain accurate if loads of people are concurrently posting???
say the maths that does it is perfect, and there is no problem with the script, it does what its mean to do. will it stay accurate in this case???
or can it still become inaccurate even though the script is adding, deducting correctly????
Thanx
