lpxxfaintxx Posted March 5, 2006 Share Posted March 5, 2006 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,lpxxfaintxxI really am desperate. Quote Link to comment https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/ Share on other sites More sharing options...
lpxxfaintxx Posted March 5, 2006 Author Share Posted March 5, 2006 Maybe I might not have made it clear enough. If you want more info, please tell me. Quote Link to comment https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/#findComment-14363 Share on other sites More sharing options...
Barand Posted March 5, 2006 Share Posted March 5, 2006 Basically you need 2 tables, one for users and one for image filenames[code]user gallery========= =======userID --+ galleryIDusername +-- userIDpwd 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. Quote Link to comment https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/#findComment-14370 Share on other sites More sharing options...
lpxxfaintxx Posted March 5, 2006 Author Share Posted March 5, 2006 What if the users wanted to make categories? Quote Link to comment https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/#findComment-14380 Share on other sites More sharing options...
Barand Posted March 5, 2006 Share Posted March 5, 2006 Third table, category, and add category id to gallery records[code]user gallery category========= ======= ==========userID --+ galleryID +--- catIDusername +-- userID | cat_namepwd imagefile | catID ----+[/code] Quote Link to comment https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/#findComment-14447 Share on other sites More sharing options...
lpxxfaintxx Posted March 5, 2006 Author Share Posted March 5, 2006 Sorry to sound like a noob but what does “----+” mean? Quote Link to comment https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/#findComment-14449 Share on other sites More sharing options...
Barand Posted March 5, 2006 Share Posted March 5, 2006 It's just to illustrate the foreign key/primary key joins in the database. Quote Link to comment https://forums.phpfreaks.com/topic/4120-how-should-i-set-up-the-database/#findComment-14452 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.