kobel4k3r5 Posted September 15, 2006 Share Posted September 15, 2006 how would i go making a friends list? i have somewhat of a way in mind but I'm not sure if this way will be efficient. it would use each row as a user, and each row will have lots of columns and some of the columns will be buddyid1, id2, etc.. Link to comment https://forums.phpfreaks.com/topic/20821-making-a-friends-list/ Share on other sites More sharing options...
btherl Posted September 15, 2006 Share Posted September 15, 2006 A better structure is to have one row for each friend relationship. You'll need 2 tables.The first table will store the user's name, user id and other data (password, name, etc etc).The second table will have two columns, "id1" and "id2". A row in that table means "id2 is a friend of id1".The problem with using columns is that you don't know how many columns you need. Rows make life much easier :) Link to comment https://forums.phpfreaks.com/topic/20821-making-a-friends-list/#findComment-92246 Share on other sites More sharing options...
fenway Posted September 15, 2006 Share Posted September 15, 2006 And more than that, good luck counting how many friends someone has if you have to count non-NULL columns... ugh. Any duplicity in rows/columns is bad. Link to comment https://forums.phpfreaks.com/topic/20821-making-a-friends-list/#findComment-92353 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.