Jump to content

interactive databases..


corillo181

Recommended Posts

anyone has good concept on how to make database that go with each other for easy use..

like if i got a pictures table..

i wanna know how i can make 2 tables one for albums and anothe rone for photo.. and mabey anothe rone for comment sone pictures.. if you get the idea..

like how can i identify one table with another..

because right now i got everything workgin the way i want.. but my database is a mess...

i got one for usr another for user pic another for comment another for picturs ..just a mess..

i want to learn how i can associated tables..
Link to comment
Share on other sites

The easiest way to do an albums/pictures structure is by having two tables, and then if you want comments, one more.

ALBUMS
----------
+ id
+ name
+ description
+ whatever

PHOTOS
---------
+ id
+ album_id (corresponds to the id column in ALBUMS)
+ caption
+ filename
+ whatever

COMMENTS
------------
+ id
+ photo_id (corresponds to id column in PHOTOS)
+ user
+ text
+ whatever else
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.