phphelp.com runs phpbb2 one of the most actively supported and widely used open source forums applications. We’re not phpbb.com, you go there to download phpbb2. It took a whole team of developers years to bring phpbb to the current level of features and reliability. I highly recommend phpbb instead of developing your own forums system unless you want to learn the process of development.
I would take a look at the phpbb source if you want to learn how a forum system is designed. Start with the database schemas included in the archive. They tell you a lot about the design decisions involved.