Images and co. from mySQL database with php

This one is heavy. In flash I have 15 image groups. Each group has 5 banknotes in it. When I choose one group, I get a screen with 5 preview pics, each with a short info text on mouse-over. On this page I can click <prev next> through all 15 groups of preview images. When I click on a preview image, I get a screen with the big banknote picture. On this screen, I can click <prev next> through other banknote pictures (front and back side - together 10 images in a group). Each banknote has a description text on the side.

I have it working in flash but now it’s supposed to work with a content management system which means the images and text are somewhere in a mySQL db and have crazy names and I have to pull them via php. H E L P P L E A S E. I don’t know how to do this in flash, for php I need some hints but not all details, I’ll have support there once I know what exactly I need.

One more time: first I choose a banknote group, somehow tell php and it sends me back 1) the names and paths for the 5 preview images, 2) the small info texts for the 5 images 3) names/links to the 10 big images of the banknotes 4) longer description texts for the 5 banknotes

thank you thank you thank you