$result=mysql_query("select * from pointtable where Latitude between '$latitude1' and '$latitude2' and Longitude between '$longitude1' and '$longitude2' ");
$posts=array();
if(mysql_num_rows($result))
{
while($post = mysql_fetch_assoc($result))
{
$posts[]=array('post'=>$post);
}
}
header('Content-type: application/json');
echo json_encode(array('posts'=> $posts));
приведенный выше код для создания ответа json. У меня есть одна форма, из которой методом POST я получаю информацию о параметре. Результат в порядке, но он открывается в поле diagloue. Я хочу напечатать этоОтвет json на странице ... что мне делать? ..
{"posts":[{"post":{"id":"1","LayarType":"college","Attribution":"Daiict","Title":"CEP Daiict","Latitude":"23.3400000000","Longitude...}
я не хочу, чтобы это начиналось ... {"posts": "post '} .. хочу начать с {id: 1 ...} что я могу изменить? ...