Is it ok to have a WHERE statement with a lot of OR's? I imagine the most could ever be 500.
I am dealing with a facebook app. Understandably (but annoyingly) they do not allow app developers to store friend relationships. As a result I can not do a sensible JOIN tblfriend or something along those lines.
To get a list of friends you can query facebook using FQL... that will return an array of facebook user ids. My thinking was to find a users most recent friend I could run a query like this:
'SELECT * FROM user WHERE fb_id = ' . implode('OR fb_id = ', $friend_array) . ' ORDER BY created LIMIT 0,1';
Is there a better way?