title: I cant get pagination to work on my search results page
body: <p>I have created a search site where people can search for items by submitting a keywords and results are displayed onto a results page. I have been trying to make the search results page include pagination because I only want to display 10 results per page. I was wondering if anyone would know how to do this as all of the tutorials I have followed don't seem to work.</p>
  
  <p>Here is the code used for my results page:</p>
  
  <pre><code>&lt;?php
  
              $button = $_GET ['submit'];
              $search = $_GET ['search']; 
  
              if(!$button)
              echo "&lt;p&gt;Sorry but we can't find any results if you do not      submit a keyword&lt;/p&gt;";
              else
              {
              if(strlen($search)&lt;=1)
              echo "&lt;p&gt;Sorry but the search term you provided is too short for     us to find any items related.&lt;/p&gt; ";
              else{
              echo "&lt;p&gt;You searched for &lt;b&gt;$search&lt;/b&gt; &lt;hr size='1'&gt;&lt;/br&gt;&lt;/p&gt;&lt;p&gt;If your site hasn't shown up just visit the Members area and submit it!&lt;/p&gt;";
              mysql_connect("localhost","username","password");
              mysql_select_db("database");
  
              $search_exploded = explode (" ", $search);
  
              foreach($search_exploded as $search_each)
              {
              $x++;
              if($x==1)
              $construct .="keywords LIKE '%$search_each%'";
              else
              $construct .="AND keywords LIKE '%$search_each%'";
  
              }
  
              $construct ="SELECT * FROM searchengine WHERE $construct";
              $run = mysql_query($construct);
  
              $foundnum = mysql_num_rows($run);
  
              if ($foundnum==0)
              echo "&lt;p&gt;Sorry, there are no matching results for     &lt;b&gt;$search&lt;/b&gt;.&lt;/br&gt;&lt;/br&gt;1. 
              Try more general words. for example: If you want to search 'how     to create a website'
              then use general keyword like 'create' 'website'&lt;/br&gt;2. Try different words with similar
               meaning&lt;/br&gt;3. Please check your spelling.&lt;/br&gt;4. If you have any ideas on sites you want to show up submit it to our database.&lt;/p&gt;";
              else
              {
              echo "&lt;p&gt;We found $foundnum results!&lt;/p&gt;";
  
              while($runrows = mysql_fetch_assoc($run))
              {
              $title = $runrows ['title'];
              $desc = $runrows ['description'];
              $url = $runrows ['url'];
  
              echo "
              &lt;p&gt;&lt;a href='$url'&gt;&lt;b&gt;$title&lt;/b&gt;&lt;/a&gt;&lt;br&gt;
              $desc&lt;br&gt;
              &lt;a href='$url'&gt;$url&lt;/a&gt;&lt;/p&gt;
  
              ";
  
              }
              }
  
              }
              }
  
              ?&gt;
  </code></pre>
  
  <p>If anyone has any ideas that may help me then that would be amazing!</p>
  
  <p>Thanks</p>