Trying to return an json array but am getting JSON Parse error
<p>To anyone who can help, I am trying to return an array and am getting
a JSON parse error yet when I run it through <a href="http://jsonlint.com" rel="nofollow">http://jsonlint.com</a> it 
returns fine. Has anybody got some suggestions as I have been at this for
quite a while and getting nowhere. Thanks to anyone who can help.</p>

<pre><code>     $.ajax({  
      url: 'images/retrieve_images.php',    
      data: 'page_id='+ encodeURIComponent(page_id),
      dataType: 'json',
      success: function(data) {

      var results = $.parseJSON(data);

        $.each(results, function(i, result) {

        $("&lt;img width='50px' height='auto' src='../article_images/"+result.image_name+"'/&gt;").appendTo("#image_list");
        $("&lt;p&gt;"+result.original_image_name+"&lt;/p&gt;").appendTo('#image_list');

        if (result.image_layout == "normal") {
        $("&lt;p&gt;&lt;input type='checkbox' name='normal' id='element_id' class='background_input element_id' value='normal' checked&gt; Normal&lt;/p&gt;").appendTo('#image_list');
        $("&lt;p&gt;&lt;input type='checkbox' name='extended' id='element_id' class='background_input element_id' value='extended'&gt; Extended&lt;/p&gt;").appendTo('#image_list');
        $("&lt;p&gt;&lt;input type='checkbox' name='revolving' id='element_id' class='background_input element_id' value='revolving'&gt; Revolving&lt;/p&gt;").appendTo('#image_list');       
        }
    });
    }
    });
</code></pre>

<p>Php retrieve below:</p>

<pre><code>$result = mysqli_query($link, "SELECT * FROM elements WHERE page_id = '$page_id'");

$rows = array();

while ($row = mysqli_fetch_row($result)) {
    $data[] = $row;
}

echo json_encode($data);
</code></pre>

<p>JSON Output below:</p>

<p>[["634","1","1","1","checked","image",null,null,null,null,null,null,null,null,null,null,null,null,"653364494e41b2baeb9f3bd8dd88380f.png","test image.jpg","extended","grayscale",null,"solid","0","0","0","000000","0","000000","0","solid","1","0",null,"0","0","0","0","000000","150","100","388","554","-100",null,"unchecked","2016-03-17 18:31:24"],["642","1","1","1","checked","image",null,null,null,null,null,null,null,null,null,null,null,null,"b320a437bcd56282ca12c06750079ad1.png","test image2.jpg","normal","rgb",null,"solid","0","0","0","000000","0","000000","0","solid","1","0",null,"0","0","0","0","000000","55","184","321","525","",null,"unchecked","2016-03-17 18:54:40"]]</p>