there are a hundred ways to do this ... but ...
perhaps you can start by installing and becoming familiar with some fairly straightforward, free components of a database-driven website.
here's a link to a tutorial which discusses installing and configuring a popular free webserver named Apache to use a free web application framework called PHP backed by a common free database called MySQL. the linked installation and configuration tutorial is for Windows Vista but if youre running another version of Windows ... or another operating system (Mac, Linux, FreeBSD) ... i'm sure by Googling around a bit you can find recipe-type instructions for getting these same three pieces set up on the operating system your computer uses ... so you can play with them and learn about them.
http://www.apache.com/installing-apache-mysql-and-php-on-windows-vista/