title: AJAX is running correctly but doesn't display fetched data
body: <p>My PHP query is running fine(based on the response on firebug) but the result its giving me are <code>[object Object]</code> on my direct page. So I'm guessing that my problem lies on my javascript because on firebug under the response tab its retrieving all my data on my database</p>
  
  <p>Here is my javascript</p>
  
  <pre><code>    function AjaxRetrieve()
              {
                var rid = document.getElementById('trg').value,
              data = {chat: uid, rid: rid, name: user};
   $.ajax({
        url: "includes/getChat.php",
        type: "GET",
        data: data,
    dataType: 'json',
     success: function(result){
       var res = $([]);
  
          $.each(result[0], function(key, value) {
              res = res.add($('&lt;div /&gt;', {text : value}));
          });
  
          $("#clog").html(res);
     }
  });
  
          }
  </code></pre>
  
  <p>The php script as requested is this</p>
  
  <pre><code>        $sql7 = "SELECT   message_content, username , message_time, recipient FROM ".$tbpre."chat_conversation WHERE msgid=:chat";
  
      $stmt7=$con3-&gt;prepare($sql7);
      $stmt7-&gt;bindValue( 'chat', $msgd, PDO::PARAM_STR);
      $stmt7-&gt;execute();
  
  
  
    $message_query = $stmt7;
  
  
  $json = array();
  
  if($message_query-&gt;rowCount() &gt; 0) {
      while($message_array = $stmt7-&gt;fetchAll(PDO::FETCH_ASSOC)) {
          $json[] = $message_array;
      }
      echo json_encode($json);
  }
  </code></pre>
  
  <p>I'm not that familiar yet on JQUERY/AJAX/Javascript so I'm not actually sure if what I'm doing is correct I just based some of my codes on jquery's documentation and some 
   suggestions from our fellow members here</p>