How to search through databases

Well I want to make a forum, either in Flash or HTML, using either PHP or ASP to search through a database when you set different parameters. LIke or something like that in Flash. I know that site looks crappy but i thought it would be good for an example :). Anyway, can someone please tell me a good tutorial on how to do this or at least tell me what I should search for? Thanks