I think the best thing you can do is to google for a tutorial to understand the basics. You can of course also look in the database part of these forums, there are tons of code that show how to do this, although most of it is in code parts of other problems.
If you need more specific help when you have done this please don't hesitate to post again.