This is what I want, on a PHP page called input.php the user submits a username by a html form. This gets stored into the MYSQL database. There is a page called results.php which querys the MYSQL database for all usernames. What I need to happen is that every 5 or so seconds some jquery code (maybe getJSON) will get a JSON string from results.php (the same page). This JSON string may be updated as a user may of added more usernames on the input.php page. This is the input.php file\[code\] <form name="input" action="<?php $_SERVER['PHP_SELF']?>" method="post"> Usernames: <input type="text" name="usernames" /> <input type="submit" value="http://stackoverflow.com/questions/10559670/Submit" name="submit" /> </form> <?php if(isset($_POST['submit'])) { $link = mysql_connect('', '', ''); if (!$link) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db('', $link); if (!$db_selected) { die ('Can\'t use : ' . mysql_error()); } $result = mysql_query("INSERT INTO users(user_name) VALUES('".$_POST['usernames']."')"); if (!$result) { die('Invalid query: ' . mysql_error()); } } ?>\[/code\]This is the results.php file \[code\] <script type="text/javascript" src="http://stackoverflow.com/questions/10559670/jquery-1.7.1.min.js"></script> <?php $link = mysql_connect('localhost', 'root', ''); if (!$link) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db('test', $link); if (!$db_selected) { die ('Can\'t use test : ' . mysql_error()); } $result = mysql_query("SELECT user_name FROM users"); if (!$result) { die('Invalid query: ' . mysql_error()); } $names = array(); while ($row = mysql_fetch_assoc($result)) { foreach ($row as $key => $val) { $names[][$key] = $val; } } echo json_encode($names); ?> <script type="text/javascript"> $.getJSON("http://localhost/test/results.php", function(json){ alert("JSON Data: " + json); }); </script> <div></div>\[/code\]I am stuck on what jquery to put or even if i'm doing this properly. The end result is like Gmail where you receive email without a page refresh. But my system would retrieve usernames from the database every 5 seconds without a page refresh. I have read about getJSON method and I am totally out of my depth with it so I may need some very in depth explanation. If im going about this objective the wrong way please let me know and inform me of good practises in how to go about this.I try this url in my browser with no result apart from the echoed JSON string from the php code.this is my JSON string[{"user_name":"matt"},{"user_name":"matt"},{"user_name":"peter"},{"user_name":"jim"},{"user_name":"sam"}]