Wait for signal from server or mysql

Wait for signal from server or mysql

Hi.

Is it possible that with the help of Jquery wait for the change in the database, and then gives an overview in a div (for example <div class="result"></div>) but with no permanent refresh div's for every "n" seconds

If this possible, can you show me an example or explain how to do it?

PS:
to be more precise

I want to just after the entry of a new row in the database, in diva result, added a new value that contains this(new row values in the database), but without constant refresh of the same div

for now, i know how to get data from mysql, and put in specific div like in this code

  1. $('input#name-submit').on('click', function(){
  2. var name = $('input#name').val();
  3. if($.trim(name) != ''){
  4. $.post('ajax/name.php', {name: name},function(data){
  5. $('div#name-data').text(data);
  6. });
  7. }
  8. });
This i needed in order to create admin panel in which  i can follow live, what users are entered into the database.