While I agree with what many have said already - why reinvent the wheel? - an answer that is going to be useful to you is going to depend on what you are trying to do.
Point #1:
If [you|your company] just need a bug tracking tool, there are numerous tools out there, free and otherwise, high quality and otherwise, why program your own?
If you're looking for a web-based service, you could use FogBugz on-demand, you could use http://www.clockingit.com/ or any of a number of other sources. I swear I've seen at least a dozen questions with twice as many suggestions around here. Search and ye will find.
If you're looking for something to run in-house, you could buy FogBugz (I only keep mentioning it because I use it and love it), you could use the aforementioned BugTracker.NET, or any of a number of other sources. I swear I've seen at least a dozen questions with twice as many suggestions around here. Search and ye will find.
Point #2:
If you are looking for a learning experience, looking for some something to learn [ChoiceLanguage] with, and/or just looking to learn more about wheels, there are a number of articles - Joel has written one or two... - and there are a number of open source projects you can peek at the code to see how they work (or not as the case may be).
In the end:
If the latter is your ultimate goal, then by all means, read the articles, do the research, and code away.
If its the former, you might want to look at something thats already been done - unless its going to be your businesses core competency.
Ultimately, the answer you get is going to depend on the question you ask. Being clear from the get-go will go a long way. ;)