Well I have to say my biggest learning curve has been mysql. Mostly because all that data normalization stuff does not intrigue me to much.
I have been messing about with building a MySQL Database for photos. I tried using the binary method for storing images into a database (that failed). Please note I am not asking about this method I am specifying a path in my db
What I would like to be able to do is build a table that has:
a category for images so I was thinking category_id int not null auto_increment primary key, a category_description text not null, here is where I am having problems, thumbnail_path varchar(255) not null, and photo_path varchar(255) I would have to build another table for the images themselves my problem is how they relate I am not really understanding that part.
so I build that table category_id int not null auto_increment now what would go after that would it be thumbnail_id or photo_id, or what. Am I just completely lost with this whole concept
any help is always appreciated
Photo Database Need Help
Moderator: General Moderators
They relate in one to many fashion I guess: many images belongs to the same category and each image belongs to exactly one category.So include category_id int into your images table structure and set it to id of corresponding category for each image.
Ask me tomorrow or later, if my explanation isn't clear enough. I'm little sleepy now
Ask me tomorrow or later, if my explanation isn't clear enough. I'm little sleepy now
Hey Thank You
Hey Thanks I was able to figure it out
A good, normalised design really is essential. http://www.oreilly.com/catalog/javadtab ... r/ch02.pdf
Hey Cool
Hey thanks for the link
if you are interested this is what my table structure looks like
create table categories ( category_id int not null auto_increment primary key, category_description varchar(255), key category_id(category_id));
create table images (image_id int not null auto_increment primary key, image_title varchar(50), image_description text not null, thumb_path varchar(255), image_path varchar(255), category_id int not null default '0' );
to me it does not look like there is going to be repeat data let me know what you think
Cheers
if you are interested this is what my table structure looks like
create table categories ( category_id int not null auto_increment primary key, category_description varchar(255), key category_id(category_id));
create table images (image_id int not null auto_increment primary key, image_title varchar(50), image_description text not null, thumb_path varchar(255), image_path varchar(255), category_id int not null default '0' );
to me it does not look like there is going to be repeat data let me know what you think
Cheers