<?php
/**
 * Created by PhpStorm.
 * User: jaskokoyn
 * Date: 4/26/2015
 * Time: 9:50 PM
 */

require('../../inc/db.php');
include('../../inc/functions.php');

$params             =   getParams();
$output             =   array('friends' => array());

if(!isset($_SESSION['loggedin'])){
    dj($output);
}

$friendsQuery       =   $db->prepare("
SELECT users.username
FROM friends
INNER JOIN users
ON friends.fid=users.id
WHERE uid = :uid
");
$friendsQuery->execute(array(
    ":uid"          =>  $_SESSION['uid']
));

$output['friends']  =   $friendsQuery->fetchAll(PDO::FETCH_ASSOC);
dj($output);