Jump to content

How should I set up the Database?


lpxxfaintxx

Recommended Posts

I am using PHP-Fusion. I want to make it so that EVERY registered user has its OWN uploader and its OWN photo gallery. How should I set up the database so that each individual user has its own column? Should I create a new table, or should I insert a new field? How would the database work? Will it create a new field for every new uploaded file? AH! I'm getting so frustrated.

Please Help,
lpxxfaintxx

I really am desperate.
Link to comment
https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/
Share on other sites

Basically you need 2 tables, one for users and one for image filenames

[code]user          gallery
=========     =======
userID  --+   galleryID
username  +-- userID
pwd           imagefile[/code]

When a user uploads an image file, add a new reocord to the gallery table with the user's id and the filename. Store the uploaded file in, say, "/images/username/filename.jpg".

A search on userID in the gallery table will pull that user's filenames.
Third table, category, and add category id to gallery records

[code]user          gallery         category
=========     =======         ==========
userID  --+   galleryID  +---  catID
username  +-- userID     |     cat_name
pwd           imagefile  |
              catID  ----+[/code]

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.