49 lines
1.5 KiB
PHP
49 lines
1.5 KiB
PHP
<?php
|
|
session_start();
|
|
require 'db_connection.php';
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head>
|
|
<title>FriendBook Friends</title>
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
|
</head>
|
|
<body>
|
|
<style>
|
|
body {
|
|
background-color: #3B5998;
|
|
color: white;
|
|
}
|
|
</style>
|
|
<?php
|
|
try{
|
|
echo '<pre>';
|
|
// echo "messageID\tdate\t\tsender\trecipient\tmessage\n\n";
|
|
$sql_select = "SELECT friend";
|
|
$sql_from = "FROM friendList";
|
|
$sql_where = "WHERE username='".$_SESSION["loggedInUser"]."' AND confirm=true";
|
|
$sql_order = "ORDER BY friend";
|
|
$sql_statement = $sql_select." ".$sql_from." ".$sql_where." ".$sql_order;
|
|
foreach($db_connection->query($sql_statement) as $row){
|
|
print $row['friends']."\n";
|
|
}
|
|
echo '</pre>';
|
|
}catch(PDOException $e){
|
|
echo "PDOException: ".$e->getMessage().PHP_EOL;
|
|
}catch(Exception $e){
|
|
echo "Exception: ".$e->getMessage().PHP_EOL;
|
|
}
|
|
|
|
echo '<h3>$GLOBALS</h3>';
|
|
echo '<pre>';
|
|
print_r($GLOBALS);
|
|
echo '</pre>';
|
|
|
|
?>
|
|
</body>
|
|
</html>
|
|
<?php
|
|
$db_connection = null;
|
|
?>
|