これを機能させるのは非常に簡単です。クーティングを配置する将来のdiv用にいくつかのhtmlが必要です。
<div id="counting"></counting>
次に、generator()関数の最後に次を追加します。
function generator(){
    /*your code here...*/    
    var element = document.createElement("div");
    element.setAttribute("id", "result");
    element.appendChild(document.createTextNode(name));
    document.getElementById("placeholder").appendChild(element);
    /*the ajax code here*/
    var url='urltophpfile/phpfile.php';
    $.get(url,function(data){
        $('#counting').html(data+' Word combinations have been generated so far.');
    });
 }
これで、phpfile.phpファイルに、カウントをインクリメントするコードが必要になります。今私もそれを手伝うことができれば、あなたはこの部分を行う方法を知っていると思います。ここにサンプルコードを追加して、アイデアが得られるようにします。
<?php
  mysql_connect('localhost', 'db-sgg', 'password') or die('Cannot connect to database server');
  mysql_select_db('db1152127-sgg') or die('Cannot select database');
  $databasecall = mysql_query("SELECT counter FROM sggcount WHERE counter > 1");
  /*so here you select the already stored value and then you make an update to increment it*/
  mysql_query("UPDATE sggcount SET counter=counter+1");
  $count = mysql_fetch_assoc($databasecall);
  echo $count['counter']+1;
?>
上記のエコーを実行すると、増分値が返され、ajaxがそれを表示します。
アップデート1
より包括的なphpコードを追加しました
注:jqueryスクリプトを追加する場合は、jqueryを使用するようにジェネレーター関数を変更してください。