First off, kudos for wanting to do the right thing, instead of just another hack-job.
Second, on the database issue, I would go for a singleton design pattern (if you don't know anything about design patterns, look it up on wikipedia.org or something, it's amazing stuff), just make sure that you have one instance of a database object that does all the queries and has a persistent connection.
Third, if you really want to do something right, you begin with design. I would suggest you check out UML and make a couple of use-cases and a class diagram. Personally I always make ERDs and flow-charts as well, because they are more ways of thinking through the problem/situation and class diagrams can quickly become more about the solution.
Fourth, document. I dunno if you've ever seen the movie Memmento (I love that movie, in case you haven't seen it though, it's about a guy with no long term memory), but the guy from that movie should even be able to work with your code. Keep every function nice and short and well documented (in something like phpDoc or JavaDoc maybe?). This will SIGNIFICANTLY help prevent code reuse and save time in the long run.
This is my $0.02 anyway.