I am currently developing a photo album page for the website I'm working on, and my idea was to create an overview of all photo albums, showing the 5 most recently added images. Two MySQL tables are used in the photo album, one of which contains album data (for example, album name, album identifier) and one that contains images (I store them in the database as drops) along with the corresponding album identifier.
However, I sofar could not find a query that allows me to get all the album data and the identifier for the last 5 pictures corresponding to the album. Hope you can help me a little.
The tables look like this:
Table: photo albums
id | album_name | album_created
-------------------------------------
1 | testalbum | 2010-11-07 19:33:20
2 | some more | 2010-11-15 18:48:29
Table: Photos
id | file | thumbnail | name | album_id
------------------------------------------
1 | binary | binary | test1 | 1
2 | binary | binary | test2 | 1
3 | binary | binary | test3 | 2
4 | binary | binary | test4 | 2
5 | binary | binary | test5 | 1
, . .
- ? .