title: jquery - parse json - 2 arrays
body: <p>How to use each parse the json type -</p>
  
  <pre><code>retrieveMessage: function()
      {
  
           $.post('ActionScripts/RetrieveMessage.php',{
  
          }, function(data) {
  
              $.each(data, function(key, reader){
  
          alert(reader.id + reader.count); //this line does not return anything
  
              });
  
          },"json");
      }
  </code></pre>
  
  <p>data: </p>
  
  <pre><code>[{"id":"1","user_name":"Jenan","user_image":"ImageName","text_chat":"Hello","date":"2011-09-25 21:29:09","error":""}][{"count":"2"}]
  </code></pre>
  
  <p>I would get text -</p>
  
  <pre><code>id=1 count=2
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>$jsonresult = array();
  
  $count = array();
  $countresult = array();
  $countresult["count"] = "2";
  $count[] = $countresult;
  while($row = mysql_fetch_array($result))
  {
  $thisResult = array();
  
  $thisResult["user_auth"] = 1;
  $thisResult["id"] = $row['id'];
  $thisResult["user_name"] = $row['user_name'];
  $thisResult["user_image"] = $row['user_image'];
  $thisResult["text_chat"] = $row['text_chat'];
  $thisResult["date"] = $row['date'];
  $thisResult["error"] = "";
  
  $jsonresult[] = $thisResult;
  }
    echo json_encode($jsonresult) . json_encode($count);
  </code></pre>
  
  <p>Here compose two collections together.
  How to read the collection with id parameters and collection of the count? Is this the right solution? What solution do I choose for composing arrays?</p>
  
  <p>Thanks for the advice.</p>