I have a mysql table with albums. Each album can be a top level album, or a child album of another album. Each album has a foldername which is the name of the folder its pictures are in. Each album also has a field called parent which is the id of the parent album. So, if I have a path to an image like this:
root/album1/album2/image1.jpg
then the album table in the database will look like this:
id parent foldername
1 NULL root
2 1 album1
3 2 album2
The question is then, how do I get the path printed earlier from this table with only mysql?