Problem with getJSON or PHP
<p><code>Display.php</code>:</p>

<pre><code>&lt;?php
include 'sql.php';
$dataget = mysql_query("SELECT `user`,`message`,`timestamp` FROM `messages`");
$arr = array();
while ($dataarr = mysql_fetch_assoc($dataget)){
    $arr[] = $dataarr;
}
echo json_encode($arr);
?&gt;
</code></pre>

<p><code>Index.php</code>:</p>

<pre><code>&lt;script type="text/javascript" src="../jquery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
        $.getJSON('display.php', function(data) {
            alert(data.0.user);
        });
    });
&lt;/script&gt;
</code></pre>

<p>Trying to alert <code>data.0.user</code>.</p>
