I’ve started working on integrated Facebook Connect with my app. I have a slight lack of knowledge problem though.
I can perfectly make it so you log into Facebook Connect on my site, etc, shows your details all FB Connect functions work. But, how do I make it so I can store the facebook user ID into my MySQL database as part of the current users information? So how I can auto log them into Facebook Connect if they have granted access?
Thanks!
Using the PHP Facebook client library, you should be able to add something this at the top of “the page”:
If the user is logged in, $facebook_id will be set to their facebook id (BIGINT). If not, it’ll be null. Mind that users need to have third-party cookies enabled in their browser for this to work past the intial “connect” call. In that case you can use the API to get the logged in user:
So basically (pseudo):