title: pagination using ajax
body: <p>I have 2 pages </p>
  
  <p>The first page for calling a second page to get all records from database, like this:</p>
  
  <pre><code>&lt;script language="JavaScript"&gt;
         var HttPRequest = false;
  
         function doCallAjax(Mode,users_ID) {
            HttPRequest = false;
            if (window.XMLHttpRequest) { // Mozilla, Safari,...
               HttPRequest = new XMLHttpRequest();
               if (HttPRequest.overrideMimeType) {
                  HttPRequest.overrideMimeType('text/html');
               }
            } else if (window.ActiveXObject) { // IE
               try {
                  HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
               } catch (e) {
                  try {
                     HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
                  } catch (e) {}
               }
            } 
  
            if (!HttPRequest) {
               alert('Cannot create XMLHTTP instance');
               return false;
            }
  
            var url = 'AjaxDeleteRecord.php';
            var pmeters = "tMode=" + Mode +
                          "&amp;tusers_ID=" + users_ID;
  
              HttPRequest.open('POST',url,true);
  
              HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
              HttPRequest.setRequestHeader("Content-length", pmeters.length);
              HttPRequest.setRequestHeader("Connection", "close");
              HttPRequest.send(pmeters);
  
  
              HttPRequest.onreadystatechange = function()
              {
  
                   if(HttPRequest.readyState == 3)  // Loading Request
                    {
                     document.getElementById("mySpan").innerHTML = "Now is Loading...";
                    }
  
                   if(HttPRequest.readyState == 4) // Return Request
                    {
                     document.getElementById("mySpan").innerHTML = HttPRequest.responseText;
                    }
  
              }
  
         }
      &lt;/script&gt;
  &lt;body Onload="JavaScript:doCallAjax('LIST','');"&gt;
  &lt;form name="frmMain"&gt;
  &lt;div style="margin-right:10px"&gt;
  &lt;span id="mySpan"&gt;&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and the second page is php that fetches data:</p>
  
  <pre><code>$strMode = $_POST["tMode"];
  $users_ID = $_POST["tusers_ID"];
  
  
  if($strMode == "DELETE")
  {
      //$strSQL = "DELETE FROM users , stores WHERE users.users_StoreId=stores.stores_ID AND users.users_ID = '".$users_ID."'";
      $strSQL = "update users set users_delete='1' where users.users_ID = '".$users_ID."'";
      $objQuery = mysql_query($strSQL) or die (mysql_error());
  }
  
  
  $strSQL = "SELECT * FROM users , stores WHERE users.users_StoreId=stores.stores_ID and users.users_delete='0' ORDER BY stores.stores_Name , users.users_Type ASC ";
  $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
  </code></pre>
  
  <p>The problem that I cannot make paging work for this.</p>
  
  <p>Can any one help me?</p>