For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > August 2004 > advise in designing some tables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author advise in designing some tables
davidklonski

2004-08-18, 3:56 pm

Hello

I am new to MySQL, and would appreciate your advise on what would be
the best way to design the following small system (I am using MySQL
5.0)

The system has photo albums which have their own data (name, category,
submitter, date, number of photos)
The system also has photos which have their own data (name, size,
width, height, date, submitter...)
The photos should be stored once in a big repository.
Photos can be assigned to photo albums, in a many-to-many
relationship:
A photo album may contain multiple photos and a single photo may
appear in multiple albums.
The system has a set of categories that the albums can belong to. An
album must belong to one of the defined categories.

I would appreciate your help
Thanks



----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums


Barand

2004-08-18, 3:57 pm

--------

Category _ _ _ _Album _ _ _ _ _Contents _ _ _ _ _Photo _ _ Submitter
_ _ _ _
_ _ _ _ _ _ _ _id _ _------- _ _albumID _ _
_ _ _ _ _ _ _ _name _ _ _ _ _ _ photoID ------ _id _
id _ _ _------ categoryID _ _ _ _ _ _ _ _ _ _ _ name _
category _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _size _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ width _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ height _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ date _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ submitterID----id
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _name
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _etc

--------

I'd go for the structure above. The contents table links the album
to the photos in the album

hth

Barand

http://members.aol.com/barryaandrew...agridguide.html easy
data tables - and more

----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com