Perfidus Posted March 14, 2009 Share Posted March 14, 2009 Hello my friends from phpfreaks, I'm working on a site with lot's of users and after registry all dat goes to the corresponding tables. Some of the features of the website are: - Adding friends to your friend list (which give them privileges) - Sending messages to other users. My question is: For the management of this features, which is the best option for DDBB? I've been thinking of creating new tables for everyuser after registering, like: friends_8787766 messages_8787766 Where the number is the user reference. Whit this system I will have LOOOOOOTS of tables in my ddbb and I wonder if this is just a crazy idea or just the way the things use to be done. Quote Link to comment https://forums.phpfreaks.com/topic/149394-advice-on-users-tables-management/ Share on other sites More sharing options...
Perfidus Posted March 14, 2009 Author Share Posted March 14, 2009 I wonder if it is better to create a simple table called Friends with the fields: --------------------------- user_ref | friend | status --------------------------- 858585 | 542541 | 1 --------------------------- Quote Link to comment https://forums.phpfreaks.com/topic/149394-advice-on-users-tables-management/#findComment-784674 Share on other sites More sharing options...
Eiolon Posted March 14, 2009 Share Posted March 14, 2009 You need a table for users and a table for users and their friends. USERS ======= id name etc. USER_FRIENDS ======= uid fid uid is the users id and fid is the friends user id. Quote Link to comment https://forums.phpfreaks.com/topic/149394-advice-on-users-tables-management/#findComment-784777 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.