Forum Moderators: coopster

Message Too Old, No Replies

Linking two tables- main users details- & -images details

Cannot fathom concept!

         

henry0

7:11 pm on Aug 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A simple map will be:
A table: users and a table img
Users = users details, user_ID auto incremented
Img = pic_ID auto incremented and pic_path

I do not see how “linking the two tables in populating and querying the DB
For example I need to be sure that user ID 1, will be “attached” to its uploaded pic in order to retrieve it by using user_ID

Further the same user 1 will have many pic that will have indeed a different pic_ID

So the question is how should I write a script that will tie user1 with all of his pics
Knowing that user ID is unique and that each pic has his own ID

Maybe passing also user ID value to img table by adding a third field?

theriddla1019

7:30 pm on Aug 5, 2004 (gmt 0)

10+ Year Member



have a field in the image table store the users unique id with it. therefore if user 12 logs in pull all pictures that contain the foreign key 12

henry0

8:17 pm on Aug 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks
so I was in the correct direction

regards

Henry