I am having problems getting getJSON call to work. At the moment it doesn't retrieve any data, however when I change the '$.getJSON' to ' $.get' it retrieves the data in it's encoded format:
[{"Page":"User Journey","Description":"Interactive User Journey Diagram","Bounce_Rate":"0","Avg_Time_On_Page":"0","Page_Views":"0","Click_Rate":"0"}
What am I missing from the $.getJSON call?
getstatistics.php:
$query="SELECT Page, URL, Description, Bounce_Rate, Avg_Time_On_Page, Page_Views,
$result=mysql_query($query);
mysql_close();
?>
<?php
$array = array();
while ( $row = mysql_fetch_assoc( $result ) ) {
$array[] = $row;
}
echo json_encode($array);
JQuery:
$.getJSON('getstatistics.php', function(data) {
$.each(data, function(index, value) {
$('#paragraphtochange').eq( index).text( value);
})
});