how to use while() with json?
<p>i have a ajax that needs to return some values, but if i use a <strong><code>while()</code></strong> to get all the result from my db, the return is "nothing".</p>

<p><strong>js:</strong></p>

<pre><code>$.post("ajax/file.ajax.php", 
  { 
    cache: false
  }, 
  function(data){ 
    alert(data.region);
  },'json'
);
</code></pre>

<p><strong>php:</strong></p>

<pre><code>while(!$res-&gt;EOF)
    {
        header('Content-Type: application/json');
        $return_data = array('value'=&gt;''.$res-&gt;fields['VALUE'].'','region'=&gt;''.$res-&gt;fields['REGION'].'');
        echo json_encode($return_data);

        $res-&gt;MoveNext();
    }
</code></pre>

<p>so, how can i use the while with json ?</p>
