title: PopUp Notice : execute php script using jquery if new record added to mysql
body: <p>i want do display information about new update from user. example :
  this is url for user
  example.com/user
  and this is url for admin
  example.com/admin</p>
  
  <p>the proses is when user post the articel the admin is automatically get notice/information the notice is like this "1 New Post added" &lt;- (popup dialog)</p>
  
  <p>so, how to run the proces for admin. "when user post the admin is automatically get notice/information" about new added post using jquery?.</p>
  
  <p>this is my file
  <strong>index.php</strong></p>
  
  <pre><code>&lt;?php
  include "popupnotice.php"
  ?&gt;
  </code></pre>
  
  <p><strong>popupnotice.php</strong></p>
  
  <pre><code>&lt;style type="text/css"&gt;
  #popup {
      visibility: hidden; 
      background-color: red; 
      position: absolute;
      top: 10px;
      z-index: 100; 
      height: 100px;
      width: 300px
  }
  &lt;/style&gt;
  &lt;div id="noticearea"&gt;
  &lt;?php
  try{
  $db = dbConn::getConnection();
  $noinf= 'Y';
  $sqlck = $db-&gt;prepare("SELECT COUNT(id_notice) as idnotice FROM str_articel WHERE notice_info=:noinf");
  $sqlck-&gt;bindParam(':noinf', $noinf);
  $sqlck-&gt;execute();
  $resck = $sqlck-&gt;fetch(PDO::FETCH_ASSOC);
  if($resck)
  {
  ?&gt;
  &lt;div id="modal"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="header"&gt;
                  &lt;div class="titlenotice"&gt;&lt;h1&gt;NOTICE/INFORMATION&lt;/h1&gt;&lt;/div&gt;
                  &lt;div class="break"&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="copy"&gt;
                  &lt;p&gt;
  &lt;?php echo $resck['idnotice']; ?&gt; New Post added
                  &lt;/p&gt;
              &lt;/div&gt;
              &lt;div class="cf footer"&gt;
                  &lt;a href="#" class="btn"&gt;Close&lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="overlay"&gt;&lt;/div&gt;
      &lt;/div&gt;   
  &lt;?php }}
  catch (PDOException $e) {
  echo "Connection Error " . $e-&gt;getMessage();
  } ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>in default page index.php if i login and no new added post i do not get notice if new post is added to db and i get notice everytime if any new.</p>
  
  <p>anyone can help? </p>