ohdang888 Posted March 22, 2008 Share Posted March 22, 2008 i have a "add friends" tool i'm building... but i'm confused as to what tables would be more efficient? Table 1 user_1_id -- user_2_id This table would have 1 row for every " friend relationship" Table 2 id (of user) -- friend_1--friend_2-- friend_3-- etc. This table would have 1 row per user, and friends would be added to the row, each under a new column Link to comment https://forums.phpfreaks.com/topic/97411-whats-more-efficent/ Share on other sites More sharing options...
pocobueno1388 Posted March 22, 2008 Share Posted March 22, 2008 The first table is more efficient. If you did the second one, how would you know how many columns to make? You would have to make hundreds, if not thousands...and there would be tons of empty ones, thats not efficient at all. Link to comment https://forums.phpfreaks.com/topic/97411-whats-more-efficent/#findComment-498440 Share on other sites More sharing options...
ohdang888 Posted March 22, 2008 Author Share Posted March 22, 2008 alright thanks! Link to comment https://forums.phpfreaks.com/topic/97411-whats-more-efficent/#findComment-498442 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.