-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messenger.php
22 lines (22 loc) · 1.18 KB
/
messenger.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include 'include/db_config.php';
include 'include/header.php';
echo '<div class="timeline">
<h2>Recent</h2>';
$result = mysql_query("SELECT *,COUNT(*) 'num' FROM message,profile Where (sender_id='".$_SESSION['id']."' and reciver_id=profileid) or (reciver_id='".$_SESSION['id']."' and sender_id=profileid) group by profileid");
while($row = mysql_fetch_array($result)) {
echo '<!--img src="images/'.$row['dp'].'" width="96" height="96" style="float:left;"-->
<h3><a href="message.php?to='.$row['profileid'].'">'.$row['username'].'</a></h3>
<small style="float:right"> '.$row['num'].'</small><br>';
}
echo '<h2>Others</h2>';
$result = mysql_query("SELECT * FROM profile WHERE profile.profileid NOT IN (SELECT profileid FROM message,profile Where (sender_id='".$_SESSION['id']."' and reciver_id=profileid) or (reciver_id='".$_SESSION['id']."' and sender_id=profileid) group by profileid) and '".$_SESSION['id']."'");
while($row = mysql_fetch_array($result)) {
echo '<!--img src="images/'.$row['dp'].'" width="96" height="96" style="float:left;"-->
</h3><a href="message.php?to='.$row['profileid'].'">'.$row['username'].'</a></h3>
<br>';
}
echo '
</div>';
include 'include/footer.php';
?>