データベースに接続するだけです
<?php
include 'db_connect.php';
友達を得る
$json = json_decode(file_get_contents('https://graph.facebook.com/me/friends?access_token=myAccessToken'), true);
それらをデータベースに挿入する
foreach($json['data'] as $friend){
mysql_query("INSERT INTO friends(id, name) VALUES (".$friend['id'].", '".mysql_real_escape_string($friend['name'])."');");
}
結局のところ、それはのように見えるかもしれません
<?php
include 'db_connect.php';
$json = json_decode(file_get_contents('https://graph.facebook.com/me/friends?access_token=myAccessToken'), true);
foreach($json['data'] as $friend){
mysql_query("INSERT INTO friends(id, name) VALUES (".$friend['id'].", '".mysql_real_escape_string($friend['name'])."');");
}