Hello, I've been dealing with this for a few days now, it's really interesting. Despite the apparent lack of functionality or connection between two script codes, if you could help, I would be very happy. Thank you in advance. // We are pulling a message... function getMessage(){ var senderId=; var receiverId=$("#divContacts input[type='radio']:checked").val(); $.ajax({ type : "POST", url : "receiveMessage.php", data : {senderId:senderId,receiverId:receiverId}, }); } // This is my PHP page that queries based on two received values; include('connect.php'); if($_POST){ $senderId=$_POST['senderId']; $receiverId=$_POST['receiverId']; $query=mysqli_query($connect,"select chat.chatId, chat.receiverId, chat.senderId, chat.content, chat.date, users.fullname, users.title from chat inner join users on chat.senderId=users.userId where chat.receiverId='$receiverId' and chat.senderId='$senderId'" ); while($data=mysqli_fetch_array($query)) { echo $data["fullname"]; echo ":"; echo $data["content"]; echo ''; } } ?>