title: create notification when user insert new order into database in php
body: <p>I recently developed a website for purchasing online. My problem is how I can create notification to alert at admin page when new order is inserted into MySQL.
  This notification will appear as an icon number at admin page on website, so that when admin open website they will know new order had made by customer.</p>
  
  <p>I know we have to use javascript ajax but I have not idea how to begin.</p>
  
  <p>I have some example code:</p>
  
  <pre><code>refreshInterval = 500
  refreshTimeout = setTimeout(getNotificationCounts, refreshInterval);
  
  function getNotifications() {
    $.ajax({
      url: 'path_to_your_php',
      type: 'POST',
      data: //put for example user_id but it cvan be handled by sesion as    
      dataType: 'json',
      success: function (data) {
        alert('You have' + data.total + ' new messages')
        refreshTimeout = setTimeout(getNotificationCounts, refreshInterval);
      }
    });
  }
  </code></pre>