View Single Post
Old 01-14-2011, 01:20 AM  
DirtyRider
Confirmed User
 
Join Date: Feb 2003
Posts: 819
database design question for galleries

I'm creating a script that will read from a database and create galleries from them. Each gallery will also link to the site its advertising.

I don't want to have a limit as to how many images a gallery will have, my question is how should I make a database for this? I also want to store the name of the image and its alt tag, the biggest problem is this. Should I store them in the same gallery table as in example 1 with possibly a delimiter, or should store it in a separate table in example 2 (which will have each image from all galleries).

I hope this makes sense, I will appreciate any advice or even any new ideas. Thanks

Example 1

Site Table

-id
-name
-link

Gallery Table

-id
-site_id
-num of images
-meta_title
-meta_desc
-meta_keywords
-header
-description
-imagename (names separated by delimiter)
-alt tag (descriptions separated by delimiter)


Example 2

Site Table

-id
-name
-link

Gallery Table

-id
-site_id
-num of images
-meta_title
-meta_desc
-meta_keywords
-header
-description

Gallery_images Table

-id
-gallery_id
-imagename
-alt tag
__________________
hello
DirtyRider is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook