I am creating a php chat application and I have two panels of this chat, 1 is admin area and other is client chat area and the content in both panel areas shows from 1 table called messages
I want to show only admin content or name in different colour other than the client users.
how to do this? any idea?
here is my code from my display_messages.php
session_start();
require_once 'cn.php';
require_once 'protect.php';
$fiveMinutesAgo = time() - 1000;
$sql = "SELECT * FROM messages ORDER BY message_time ";
$result = mysqli_query($cn,$sql) or
die(mysqli_error($cn));
while ($row = mysqli_fetch_assoc($result)) {
$user = $row['username'];
$msg_content = $row['message_content'];
$hoursAndMinutes = $row['message_time'];
echo '<p><cite class="fa fa-user"><b>'. $user .':</b></cite> <output>'. $msg_content .'</output> <time class="fa fa-clock-o time">: ' . $hoursAndMinutes . ':</time></p>';
}
any help would be appreciated.
thanks.
` or ``
– Sean Jul 19 '14 at 20:02