showing messages with:-
$query = "SELECT * FROM `chat` WHERE fromthe = '$email' and tothe='theadmin' UNION ALL SELECT * FROM `chat` WHERE fromthe = 'theadmin' and tothe='$email' order by id desc";
mysqli_query($con, $query);
unreaded message:-
$query = "SELECT status FROM chat WHERE status=0";
mysqli_query($con, $query);
status == 0
- unreaded
status == 1
- readed..
how to do the auto fetch message without reloading the page by using ajax??