Loading images from a Database

Anyone have anyideas on how to load an image from a database.

Heres the thing!!..The flash site im wokring on had to allow the user to obtain images from a database. So whats happening is that on a button click a new window opens allowing the user to browse a selection of images and once they choose an image the iamge should appear in the flash.

Any ideas will be most appreciated

Thank

sure well you can use php or asp, php will prob be easier