paulswansea Posted February 22, 2008 Share Posted February 22, 2008 I have a database of users, each user has an autoincremented id number field, and various other fields with their details on. I would like to store within the user record a field with an array of friends. I would like the most efficient way to store and be able to search each users 'friend id array' field and list the friends ids per user search. assuming at some point there could be a million users of which each has a million 'friend ids' in their array, I dont think having them comma seperated would be efficient, any solutions? could it be stored in a blob and searched bitwise? Quote Link to comment https://forums.phpfreaks.com/topic/92368-storing-a-massive-array-of-numbers-within-a-field/ Share on other sites More sharing options...
beebum Posted February 22, 2008 Share Posted February 22, 2008 Sounds like you have a many to many relationship. http://www.tonymarston.net/php-mysql/many-to-many.html http://www.wellho.net/solutions/mysql-many-to-many-table-mapping-pivot-tables.html Quote Link to comment https://forums.phpfreaks.com/topic/92368-storing-a-massive-array-of-numbers-within-a-field/#findComment-473359 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.