Talk:User (FQL)

From Facebook Developer Wiki

Revision as of 20:56, 6 October 2009 by Pete Bratach (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

[Taranjeet]: @Pete: Many Thanks Pete...that was a great help.

Sure thing, Taranjeet. Remember you need to enclose strings (like username for example) in quotes. UIDs are INTs and don't need the quotes. Pete -- 563683308 13:56, 6 October 2009 (PDT)

[Taranjeet]: @Pete: I can illustrate it by writing: for e.g. I'm writing this: "SELECT uid FROM user WHERE username=taran21".....and it gives me an error "taran21 is not a member of USER table....I provide any username, it gives me the same error....could you please suggest a solution?? Many thanks

Right, because you're not wrapping the username in quotes. Format your query like this:
SELECT uid FROM user WHERE username="taran21"
And you'll get your UID in response to the query, like this:
<?xml version="1.0" encoding="UTF-8"?> <fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"> <user> <uid>701576125</uid> </user> </fql_query_response>
Pete -- 563683308 10:37, 6 October 2009 (PDT)


[Taranjeet] If I make a query like: "SELECT username from user WHERE uid=XXX", I get a proper response. But iinstead if I type in "SELECT uid from user WHERE username=XXX"...It gives me an error((xxx[which is the username] is not a member of USER table))....Anybody tried that?? If so please can you tell me why it behaves like this?

Are you wrapping the user name in quotes? Pete -- 563683308 14:36, 5 October 2009 (PDT)

[Jack] I'm trying to use 'sex' in an application that I'm building, but it often comes up blank, even for people that I know have it set. Do we not have permission to access it, or is there a different column to use? (Why reinvent, the wheel, right?)

[Dan] I'm trying to use 'meeting_sex' in an application that I'm building, but it always comes up blank, even for people that I know have it set. Do we not have permission to access it, or is there a different column to use? (meeting_sex is not publicly accessible by default. I think).

I changed the type of hometown_location from string to array as it is definately an array that is returned. I assume the same of current_location though i haven't checked this yet.

[Mike@FB] Users have to explicitly grant permission to those fields to expose them. They are working for me, however, when the user enables them in their privacy setting.

--

[Pete] How will has_added_app change when the notion of adding apps goes away? Perhaps it could return TRUE if the user has ever authorized the app.

[Mike@FB] I've updated the wiki article. has_added_app is now equivalent to is_app_user. We will eventually deprecate this column.

--

[Bill] I think the uid here is erroneously listed as int rather than BIGINT. Can a Facebook person confirm?

[Mike@FB] Yes, uids are ints, which I've just updated to say are 64 bits in length.

--

[Todd] How can we gracefully handle when the pic or pic_small, etc. is a blank URL? Does FB have default URL that can be used to show for example the same pic that is shown on the profile when the user doesn't have a pic?

--

[Rich] Is there a "record creation date" or "date user joined facebook" field available?

Not at this time, no. You can file a feature request for one. Make sure to provide some use cases. Pete (563683308 15:23, 11 June 2009 (PDT))

--

[Adrian] Guys, why does FB say "username is not a member of the user table"?

select username from user where uid=XXXXXXXXX

Exception Thrown:  FacebookRestClientException
Code: 602, Message: username is not a member of the user table.

I have no problems with "select name from user where uid=XXXXXXXX" or any other field. Thanks.

The weekly push will start in a couple hours, so this should be up and running in a few hours. Check your query against the beta site: www.beta.facebok.com Thanks, Pete (563683308 13:51, 7 July 2009 (PDT))

--

[edit] religion field in user table

Is this field protected ? I only can retrieve my own religion ! Else I get : <religion xsi:nil="true"/>

reference