Sounds like you've taken on a big project to learn on when you don't know the fundamentals of HTML & CSS
If I was you, I'd invest in some of the Sitepoint (
www.sitepoint.com) CSS books and take a look through their tutorial sections while you're over there.
As I suggested, simply store the stylesheet name in the database and when you create the HTML page in your PHP code, pop this into the header as an additional stylesheet link.