Marek Kilimajer wrote:
Dimitri Marshall wrote:
I'm making a message board and I've decided the best way to go about the
structure is to have 3 tables, two of them will be "Posts" and "Replys".
Now, in order for this ti work, each post has to have a UniqueID - same with
the replys. Looking at another program, I can see that one way to do this is
to do it by rows (ie. count how many rows, add 1, then that is the ID). It
would be unique because no two rows would be 1 for example.


The problem I can see is that the database would become incredibly huge
(size wise I mean). I want to delete the posts after 30 days, and if I
delete the row, then that would mess up the row system.

Any suggestions?

Have you heard about auto_increment? Read on: http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html

Keep reading about database design, too. You'll only need one table and a "parent-child" relationship. The initial post will have a parent of "zero" and "child" posts under it will have a parent column relating back to the original post.


I may not have explained that the best way, but there are plenty of articles out there about it. Have fun. :)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to