View Single Post
Old 12-05-2012, 02:43 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Avoid writing multiple queries especially if you need to loop them.
Are these images only ever available in one gallery? Given null entries here, that indicates that there is something not correct with the design which will cause problems later. A simpler approach would be to create a table with a galleryid and imageid and create a composite of these. A third table with the gallery information is used, but only necessary if specific information is applied. This lets you create the many to many should an image reside in more than one gallery and provides an easy to join column. Mostly software to require enforcement of sizes though since you can't enforce it to contain <= 15 from the storage side.
Fou-Lu is offline   Reply With Quote