<?php
error_reporting(0);

include('db_connect.php');
if(isset($_GET['id'])){
    $user_is=$_GET['id'];

$r=mysqli_query($conn,"select DISTINCT si.sender_id,si.receiver_id,si.item_id, gl.item_name,gl.item_desc,gl.status,ur.name,ur.email_address,ur.token
						FROM shared_items si
						INNER JOIN grocery_list gl 
						ON
						si.item_id = gl.item_id
                        INNER JOIN users ur 
						ON
						si.sender_id = ur.id
						where si.receiver_id = '$user_is'");
while($row=mysqli_fetch_assoc($r))
{
$cls[]=$row;
}
echo json_encode($cls);
}
mysqli_close($conn);

?>