This is a good time to slip in a plug for Philip Greenspun's book, "Philip and Alex's Guide to Web Publishing," which you can buy from any of the online bookstores or read on his Web site here:
http://www.arsdigita.com/books/panda/
It's bright, funny, readable, and informative. Everybody posting here should read these chapters:
10.Sites that are really programs
11.Sites that are really databases
12.Database management systems
13.Interfacing a relational database to the Web
Philip is particularly enamored of AOLServer, an open-source server that allows a programmer to embed TCL in Web pages much in the same way that PHP lets you embed its scripting language. Anything that can be done with AOLServer and TCL can be done with Apache and PHP. (Or, for that matter, AOLServer and PHP.)
My favorite quote from the book: "The basic pricing strategy of database management system vendors is to hang the user up by his heels, see how much money falls out, take it all and then ask for another $50,000 for 'support'."