I don't see you inserting the data into the photo or gallery tables. filedata basically has the image data for every file, but photo has the nodeid for each along with any caption. And then gallery keeps track of everybodies 'galleries' (a person may have several galleries each for a different subject).
So, say I have three 'galleries' in my media tab, like this:
Cats
- image 1
- image 2
Dogs
- image 3
- image 4
Favorite Images
- image 1 (again)
- image 4 (again)
That is four different entries into the filedata table (for four different images)
That is six different entries into the photo table (for each time the image is used)
That is three different entries into the gallery table (for the three galleries for this user)
That is nine different entries into the node table (for the three galleries and the six photos)
I hope that helps out.
|