<?php 

require 'db.php';

$sels = $con->query("select * from queries");
while($rows = $sels->fetch_assoc())
{
    $cat =  $con->query("select name,mobile from user where id=".$rows['uid']);
	if($row = $cat->fetch_assoc())
	{
	    $p['name'] = $row['name'];
        $p['mobile'] = $row['mobile'];
	}
	$date=date_create($rows['message_date']);
	$p['date'] = date_format($date,"d-m-Y");
// 	$p['date'] = $rows['message_date'];
	$p['message'] = $rows['message'];
	$p['status'] = $rows['status'];
	$cp[] = $p;
}

echo json_encode($cp);
?>