1

您好我正在使用以下 FQL 从 facebook 获取好友列表及其详细信息

select uid, name, work_history, education_history, current_location from user where uid IN (select uid2 from friend where uid1=FACEBOOK_USER);

我得到以下结果数组,它很好且正确。

现在我的问题是如何获得朋友工作的公司ID。公司的唯一标识符,以便我可以使用例如 http://graph.facebook.com/cocacola (获取可口可乐公司/粉丝页面详细信息的示例)获取公司特定详细信息?

比如在 GO-AdventureSports 工作的朋友在数组中也应该有唯一的标识符。

数组([0] => 数组([uid] => 12312312312 [name] => Raj Singh [work_history] ​​=> 数组([0] => 数组([company_name] => Intersil)

            )

        [education_history] => Array
            (
            )

        [current_location] => Array
            (
                [city] => Santa Clara
                [state] => California
                [country] => United States
                [zip] => 
                [id] => 1231231231
                [name] => Santa Clara, California
            )

    )

[1] => Array
    (
        [uid] => 123123123
        [name] => Rana Sidhu
        [work_history] => Array
            (
                [0] => Array
                    (
                        [location] => Array
                            (
                                [city] => 
                                [state] => 
                            )

                        [company_name] => GO-AdventureSports
                        [description] => 
                        [start_date] => 
                        [end_date] => 
                    )

            )

        [education_history] => Array
            (
            )

        [current_location] => 
    )

任何想法都受到高度赞赏...

4

2 回答 2

0

在上面的 sql 查询中,只需添加工作,它将返回公司名称及其 id。现在,如果想要work_history可以忽略。

最终查询

select uid, name, work_history, work, education_history, current_location from user where uid IN (select uid2 from friend where uid1=FACEBOOK_USER);

希望对某人有所帮助。

-deepak

于 2011-03-17T16:20:13.773 回答
0

试试这个查询:

select uid, name,work, work_history, education_history, current_location from user where uid IN (select uid2 from friend where uid1=FACEBOOK_USER);

work 在 facebook 上用它的 id 给出公司名称,而 work_history 没有给出 id,只给出简单的信息。

请参阅以下输出:

[work] => Array
                (
                    [0] => Array
                        (
                            [employer] => Array
                                (
                                    [id] => 105551752814478
                                    [name] => Fujitsu Consulting India Ltd
                                )

                            [location] => Array
                                (
                                    [id] => 106442706060302
                                    [name] => Pune, Maharashtra
                                )

                            [position] => Array
                                (
                                    [id] => 139966739368093
                                    [name] => IT Consultant
                                )

                            [start_date] => 2009-10
                            [end_date] => 0000-00
                        )

                    [1] => Array
                        (
                            [employer] => Array
                                (
                                    [id] => 109256905760858
                                    [name] => Fujitsu
                                )

                        )

                )

            [work_history] => Array
                (
                    [0] => Array
                        (
                            [location] => Array
                                (
                                    [city] => Pune
                                    [state] => Maharashtra
                                )

                            [company_name] => Fujitsu Consulting India Ltd
                            [position] => IT Consultant
                            [description] => 
                            [start_date] => 2009-10
                            [end_date] => 0000-00
                        )

                    [1] => Array
                        (
                            [location] => Array
                                (
                                    [city] => 
                                    [state] => 
                                )

                            [company_name] => Fujitsu
                            [description] => 
                            [start_date] => 
                            [end_date] => 
                        )

                )
于 2012-02-15T10:33:52.217 回答