corillo181 Posted May 13, 2006 Share Posted May 13, 2006 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.. Quote Link to comment Share on other sites More sharing options...
Zubaz Posted May 13, 2006 Share Posted May 13, 2006 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+ whateverPHOTOS---------+ id+ album_id (corresponds to the id column in ALBUMS)+ caption+ filename+ whateverCOMMENTS------------+ id+ photo_id (corresponds to id column in PHOTOS)+ user+ text+ whatever else Quote Link to comment Share on other sites More sharing options...
corillo181 Posted May 13, 2006 Author Share Posted May 13, 2006 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=$)? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.