View Single Post
  #4 (permalink)  
Old September 3rd, 2007, 11:16 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Here's what I would do conceptually.

1. Extend the Photo table with a ParentId

2. When inserting the main picture, leave this ParentId empty.

3. Redirect to a new page and forward the new PhotoId of the picture you just inserted.

4. On this new page, allow the user to insert 5 (or any number) of pictures and save them in the database. Pass the Id of the first image from step 3 in the ParentId picture.

5. When you display the main PhotoPicture you can query its children using something like

SELECT .... WHERE ParentId = Id

where Id is the ID of the main picture.


Does this help?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004