title: Need a Pagination PHP code to integrate with my SEARCH php script
body: <p>It's been a month and am really messed up trying to integrate a php pagination code to my search script. Referred to most of the tutorials Googling, but in vain. Any help would be much appreciated. Here I go...</p>
  
  <pre><code>&lt;?php
   ob_start();
   session_start();
   $_GET['term'] = trim($_GET['term']);
   $output = preg_replace('!\s+!', ' ', $_GET['term']);
   if(empty($_GET['term'])|| preg_match("/^[@!#\$\^%&amp;*()+=\-\[\]\\\';,\.\/\{\}\|\":&lt;&gt;\?\ _ ]+$/i", $_GET['term']) || $output== ' ' || $_GET['term']== "%24_GET%5B%27term%27%5D")
   {
   echo "&lt;BR&gt;";
   echo "&lt;BR&gt;";
   echo("Please enter a Valid Search term");
   }
   else
   {
      mysql_connect("localhost", "root", "root");
      mysql_select_db("search");
      $_GET['term'] = explode(' ', $_GET['term']);
      foreach($_GET['term'] AS $_GET['term'])
       {
       $_GET['term'] = trim($_GET['term']);
   $sql = mysql_query("SELECT DISTINCT * FROM searchengine WHERE pagecontent LIKE '%" . str_replace(' ', "%' AND pagecontent LIKE '%", $_GET['term'])."%' LIMIT 0,10");
     while($ser = mysql_fetch_array($sql)) {
         echo "&lt;BR&gt;";
          echo "&lt;b&gt;&lt;u&gt;&lt;a href='$ser[pageurl]'&gt;$ser[title]&lt;/a&gt;&lt;/u&gt;&lt;/b&gt;";
          echo "&lt;BR&gt;";
          echo("&lt;span class='style_block'&gt;{$ser['pagecontent']}&lt;/span&gt;");
          echo "&lt;BR&gt;";
          echo ("&lt;a href='$ser[pageurl]'&gt;$ser[pageurl]&lt;/a&gt;");
          echo "&lt;BR&gt;";
          echo "&lt;BR&gt;";
         } 
      }
  $count=mysql_num_rows($sql);
  if($count==0)
  {
   echo "&lt;BR&gt;";
   echo "&lt;BR&gt;";
  echo "Sorry, No News material was found... Please refine your search criteria and try again.";
  }
      }
  ?&gt;
  </code></pre>