Facebook fql query using LIMIT and ORDER BY sorting ASC or DESC

Share on TwitterDigg This

facebook fql query

FACEBOOK fql query using ORDERBY and LIMIT

FQL can handle simple math, basic boolean operators, AND or NOT logical operators, and ORDER BY and LIMIT clauses.Below given a small example to demonstrate the fql query in face book usning an example

To get facbook album photos by album id

here we fetch 40 album photos details created latest by using “ORDER BY created DESC LIMIT 0,40″

function get_photos_by_album_id($album_id){
if($album_id)
        $fql            =   'SELECT pid,src_big,owner,link,position,created,caption,src FROM photo WHERE aid="'.$album_id.'" ORDER BY created DESC LIMIT 0,40';
	 $param  =   array(
                'method'    => 'fql.query',
                'query'     => $fql,
                'callback'  => ''
            );
            $fqlResult   =   $this->facebook->api($param);
		return $fqlResult;
 
}

Related

About prabin t p

Connect with me on Google+
This entry was posted in facebook and tagged , , , , . Bookmark the permalink.

One Response to Facebook fql query using LIMIT and ORDER BY sorting ASC or DESC

  1. Rohit says:

    Thanks for any other magnificent post. Where else may just aynone get that kind of info in such a perfect method of writing? I’ve a presentation next week, and I’m at the search for such info.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">