Start learning with our library of video tutorials taught by experts. Get started
Viewers: in countries Watching now:
Learn the basics of building complex, data-driven applications with the Facebook PHP SDK and MySQL. Author Ray Villalobos first introduces the fundamentals, such as checking to see if a user is logged into an application, accessing Facebook user data through the Open Graph API, and making complex API calls with the Graph API Explorer. The course then dives into building an application with API paths and Facebook Query Language (FQL) calls. Along the way, you'll discover how to post to a user's wall, upload photos, integrate with webpages, and more.
Using the PHP SDK gives you the benefit of being able to access the Open Graph with a special language called FQL. FQL stands for Facebook Query Language. And if you're used to SQL, then FQL will be very similar to you, so most PHP developers should be able to pick it up quickly. The language has some features not in the Graph API, like the ability to batch multiple queries in a single call. Unlike SQL, the FROM clause can only contain a single table, that means you can't do joints with this language.
However, the IN keyword can do sub queries, but only within its own scope. Queries must be indexable, which means that you can only perform queries that include WHERE on fields that are indexable. So you can't, for example, say, give me the user ID of every user in Facebook. You have to qualify that by saying that you want users who are also your friends. You can check the documentation to see which fields need to be used in the WHERE clause. Let's look at the tables on the left of the documentation and click on any one of these tables, and the fields that are indexable will be marked right here.
So you need at least one of those in your WHERE clause. You can use ORDER BY and LIMIT clauses. Just remember that this is not full SQL so there's always limits to what FQL can do. Also the data is returned in the JSON format, so we have to parse that using the file_get_Contents method to read the queries and then feed those results into the JSON-encoded method. That will give us an associative array that we can work from. So although you might be disappointed that FQL is not as powerful as SQL, it does give you another great tool to dig into the user data available through the Open Graph.
There are currently no FAQs about Building Facebook Applications with PHP and MySQL.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.