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
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.
Link to comment
Share on other sites

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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