I am building a small facebook app. Trying to search for values in an auto compelte manner. Is it possible to use sql's like operator in fql?
问题:
回答1:
There is no LIKE operator in FQL.
However, you may have luck with the IN operator:
WHERE "Stanford" IN education_history.name
This page may also help and has sample queries:
- FQL
回答2:
Another way for you is to use the strpos(message, "content you want") >= 0. I don't know why, but the IN operator does not run for me. Did anyone try it?
回答3:
I know this thread is long since dead but I'm sure this may help someone in the future. FQL has its uses in some respects, but as far as searching for public information goes, I would recommend using the new graph api. I compared a simple FQL query with a similar graph query and on average, the graph was almost three times as fast (0.3s vs 0.8s). Here is a my graph example using PHP and CURL:
$search = "platform";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/search?q=".$search."&type=page");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$fbPages = json_decode($output)->data;
print_r(array_slice($fbPages, 0, 10));
Hope that helps!
PS: if you are not running PHP version 5.2.0 or above you will need a JSON decoder found here.
EDIT: you can find some useful documentation here.