mysql_fetch_assoc Problem!
Hi All
I'm trying to develop a photo gallery that is categorized simply by year, gallery and photos. ie The ability to be able to create a year, a gallery associated to the year and photos associated to a particular gallery. I've come a little unstuck when tryimg to retreive the information from the database.
There are 3 tables in the database, Year, Gallery and Photos. The year table stores the name of the year, the gallery stores the names of the gallery and the id key of the year table, and the photos table stores details of the photographs and the id key of the gallery table. (please see images below)



The code so far retreives and displays all the available years and when a particular year is selected, the relevant year and associated galleries are displayed, but, and here's the problem, only the photos associated to the first gallery in each year are being retreived and displayed. (see screen shots below)(Left Image: Page displayed :: Center & Right Image; PHP/Mysql Code)



As you can see from the tables above, gallery 4 should display photo 2, I think the problem is with the code circled in the center image in that it's only retreiving the gallery id for one record instead of for all records. I'm sure the solution to this will be quite simple, but I've hit a brick wall with it, so any help or suggestions will be much appreciated.
Many Thanks
Nick
