Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

interactive databases..

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..

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
alright so can you give me a query example of how i could realte that phtop id with the comment photo id..

(inser into photo,comment where id=$)?

Share this post


Link to post
Share on other sites

×

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.