AJAX / PHP - 访问JSON对象属性

I'm attempting to access the properties of a JSON object. My ajax call is:

$.ajax({
  url: 'login.php',
  type: 'post',
  dataType: 'json',
  data: $('#frmLgn').serialize(),
  success: function(data) {
    console.log(data[0].message);
    console.log(data[1].message);
    console.log(data[2].message);
}

The PHP is:

for ($i = 0; $i < $queryMsgCntResults; $i++) {

  $queryGetNew = "SELECT message, msgID FROM $username WHERE isNew = 1;";
  try
  {
    $stmt = $db->prepare($queryGetNew);
    $stmt->execute();
    $message = $stmt->fetch(PDO::FETCH_ASSOC);
    $messageArray[] = $message;         
  } 
  catch(PDOException $ex)
  {
    die("Failed to run query: " . $ex->getMessage()); 
  }     
}
echo json_encode($messageArray);
}

I am expecting this to output:

    console.log(data[0].message); //contents of message1
    console.log(data[1].message); //contents of message2
    console.log(data[2].message); //contents of message3

But instead get:

    console.log(data[0].message); //contents of message1
    console.log(data[1].message); //contents of message1
    console.log(data[2].message); //contents of message1

What am I missing/messing up?

Please close this question. I'm going to re-organize, re-test, and quite likely re-post for clarity. I appreciate all of your assistance, and apologize for wasting anyone's time. Thank you.

$message = $stmt->fetch(PDO::FETCH_ASSOC);

This line gets one row at a time. You need to keep calling it over and over to get every row.

while($message = $stmt->fetch(PDO::FETCH_ASSOC)){
    $messageArray[] = $message;
}