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. 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 --------------------------- 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. 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
Archived
This topic is now archived and is closed to further replies.