I'm working on a simple facebook application where I'm storing:
Facebook friends ID
Table structure:
Table name: facebook_mapping Values:
app_id fb_id
1 100003996070108
2 100003960002436
3 100003955972927
4 100003955972924
using fql query:
SELECT uid2 FROM friend WHERE uid1=FACEBOOK_USER_ID
This works well for friends less than 200. But if a user has more than 200 friends, when I run the application page for the first time, it times out always. I think it takes more than 30 seconds and my server has a constraint that it would timeout after 30 seconds.
I'm using PHP & MySQL. One solution I think is:
1) First only take 20 friends of that user and add it in database 2) Run a background process to gather other friends
Please help me to setup a background process to gather friends or some other method to do this.
Thanks.