Facebook New PHP SDK For Graph API - Multi Query -
i'm @ wits end in queries parameter value should like. sumbit multiquery accross graph api library, following code method perform it, far can tell.
$param = array( 'method' => 'fql.multiquery', 'queries' => $multiquery, 'callback' => ''); $queryresults = $facebook->api($param);
using method in new php sdk library facebook, has 1 made work? if can drop example on how build complete value of $multiquery
variable?
i've been struggeling few days , i'm finding exmaples old php library.
why after banging head days, ask question, , 5 minutes later, come answer self.
so here lovely experience.
since in php can use "
/'
character start text string, got self stuck in flip flopping of double quote character , single quote character. dawned on me queries defined in multi query are, duh, wrapped double quotes.
so lesson learned? if have clause uses string value in multi query, make sure pete's sake use single quotes around string value filtering on.
bad bad - did. note double quotes around myvalue , myothervalue. naughty!
$multiquery = { "query1":"select something somecolumn = "myvalue"", "query2":"select something somecolumn = "myothervalue"" };
good example - @ myvalue , myothervalue.
$multiquery = { "query1":"select something somecolumn = 'myvalue'", "query2":"select something somecolumn = 'myothervalue'" };
so can...
$multiquery = { "query1":"select something somecolumn = 'myvalue'", "query2":"select something somecolumn = 'myothervalue'" }; $param = array( 'method' => 'fql.multiquery', 'queries' => $multiquery, 'callback' => ''); $queryresults = $facebook->api($param);
and if of wondering actual type of $multiquery
variable (for newbie me), it's string data type. it's not array, nothing more nifty text.
Comments
Post a Comment