Jump to content

Need ideas for database design for html alt tags


rusty338

Recommended Posts

I'm designing a site that can store photo galleries. So an 'x' number of images will be in a gallery, right now there is not limit, I'm wondering to make this work if I need one. I want for each image to have an alt tag - or even a description, same kind of idea. Now, I'm not really sure how to design a database for this. Should I limit each gallery to have only say 200 images, and in a table only have 200 different fields?

 

Any advice or leads would be greatly appreciated :)

Link to comment
Share on other sites

Should I limit each gallery to have only say 200 images, and in a table only have 200 different fields?

 

Why would you limit the gallery to 200 images, and why would it take 200 fields to store 1 image?

 

All you would really need to store are the path to the actual image, the alt , height and width attributes, a description and a few foreign keys relating the image to an owner, and gallery.

Link to comment
Share on other sites

have a table with

 

photo_url - the location of the photo

alt_text - the alternitive text to display

userid - the userid of the owner.

 

then when it comes to something like showing all the photos for a user. you can loop through each row that has the users id. use the photo_url to show the photo (src="") and the alt_text to show the alt text in the image tag.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.