<?php 
$query = 'select * from users_photo ' . "where userID=" . $customerID;
$result = $db->query($query);
$num_results = $result->num_rows;
for ($i = 0; $i < $num_results; $i++) {
    $row = $result->fetch_assoc();
    echo '<img src="users_photo/' . $row['photo'] . '" height="100">';
}
?>

<section>
<?php 
if (isset($_GET['customerID'])) {
    $customerID = $_GET['customerID'];
}
print_basic_info($customerID, $db);
?>

description: <br/>
<p>
<?php 
$query = 'select * from users_description ' . "where userID=" . $customerID;
$result = $db->query($query);
$Intro = NULL;
$Mate_Criteria = NULL;
$Life_Style = NULL;
while ($row = $result->fetch_assoc()) {
    switch ($row['type']) {
        case "Intro":
            $Intro = $row['description'];
            break;
Beispiel #2
0
<header>
<h1>heydate</h1>
</header>

<nav>
<a href="index.php">Main</a>
<a href="logout.php">Logout</a>
<a href="registration.php">Register</a>
<a href="profile.php">profile</a>
</nav>

<section>
<?php 
$action = "profile_action.php";
$action_postfix = '?';
print_basic_info($_SESSION['valid_userID'], $db);
?>

<?php 
$query = 'SELECT * FROM users_account RIGHT JOIN(SELECT receiverID FROM
              (SELECT receiverID, time FROM `users_message` WHERE senderID=' . $_SESSION['valid_userID'] . '
              UNION
              SELECT senderID, time  FROM `users_message` WHERE receiverID=' . $_SESSION['valid_userID'] . ') 
              as X group by receiverID order by time DESC)as Y on userID=receiverID';
$Contacters = $db->query($query);
while ($row1 = $Contacters->fetch_assoc()) {
    $contact = $row1['receiverID'];
    $contact_name = $row1['name'];
    $query = 'select * from users_message ' . "where (senderID=" . $_SESSION['valid_userID'] . " and receiverID =" . $contact . ")or" . "(receiverID=" . $_SESSION['valid_userID'] . " and senderID =" . $contact . ")" . 'order by time desc';
    $message_history = $db->query($query);
    echo 'contactID: ' . $contact_name;