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
https://forums.phpfreaks.com/topic/9571-interactive-databases/
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
https://forums.phpfreaks.com/topic/9571-interactive-databases/#findComment-35347
Share on other sites

Archived

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

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