Lautarox Posted November 1, 2010 Share Posted November 1, 2010 I'm building a facebook application, as it is intendeed to reach to a big ammount of users, I'm worried about the performance of it, I'm querying facebook to get user's friends and then I'm searching for each of them in a mysql database, what would you recommend me to do? Is it better to perfom separated querys looking for each user or should I make a query looking for all the users, something like, SELECT * FROM table WHERE id=id1 AND id=id2 ... Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/217449-searching-for-a-user-list-in-database/ Share on other sites More sharing options...
snowman15 Posted November 8, 2010 Share Posted November 8, 2010 I would gather all the ID's your looking for in an array, then use a loop to build an sql statement with lots of 'id=id1 OR' (then repeat) and do one single query. Quote Link to comment https://forums.phpfreaks.com/topic/217449-searching-for-a-user-list-in-database/#findComment-1131968 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.