<?php
	include('db.php');
// Check connection
if ($con->connect_error) {
    die("Connection failed: " . $con->connect_error);
}
$username=$_GET["id"];
$sql = "SELECT * FROM `tbl_Feedback` where stud_id='$username'";
$result = $con->query($sql);

if ($result->num_rows > 0) {
    $items = array();
    // output data of each row
    while($row = $result->fetch_assoc()) 
	{
		$item[] = array("student_id " => $row['stud_id'],
					  "Subject" => $row['Subject'],
					  "Message" => $row['Message'],
					  "ReceivedDate"=> $row['ReceivedDate']
					 );

    }
	$message=$item;
	$response=array('status' => "true", 'Message' => "Login success",'Login_details' => $message);  
            echo json_encode($response);
	
	} 
	else 
	{
     $response=array('status' => "false", 'Message' => "No Data");
            echo json_encode($response);
	}
$con->close();
?> 
