mm559 Posted August 20, 2010 Share Posted August 20, 2010 Hey everybody, please help a newba out........ I am trying to allow users to create a favorites list. Basically there will be a list of links users can access, and I want them to be able to add individual links to their own favorites list. I'm pretty new to php and mysql, but here's what i'm thinking... User registers. User gets added to table "users", and a new table is created "new_user_1 favorites" User clicks "add to my favorites", next to a link they like. Link is added to "new_user_1 favorites". Table "new_user_1 favorites" is displayed under link "My Favorites". How does this sound? Is this the way to do it, or is there something i'm missing? Do I really need a individual table for each users favorites, or is there an more efficient way? Any input would be appreciated. Thanks folks. Quote Link to comment Share on other sites More sharing options...
kickstart Posted August 20, 2010 Share Posted August 20, 2010 Hi No need to create a new table for each user (and doing so would make the database hideous to look at rapidly). Have a table of favorites, with one row per user per favorite. ID - Int User - Int - ID field of the user in the users table Favorite - Int - ID field of the favorite in the table of possible favorites. All the best Keith Quote Link to comment Share on other sites More sharing options...
mm559 Posted August 21, 2010 Author Share Posted August 21, 2010 Awesome thanks Keith. Just the answer I was hoping for. Thanks for the help! 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.