用PHP的下一个和上一个按钮

I have been having a problem getting next and previous buttons to work using a php webpage connected to mysql database. I am not sure what is wrong but i think it may have something to do with the offset. Right now the button are not working at all you click them and nothing happens. Also the form is made as a search page.

Here is the search code:

<?php
     include("../web-admin/dbconfiginc.php");
 $result = mysql_query("SELECT * FROM videos WHERE ID = '$ID'");
 $row = mysql_fetch_array($result);

 ?><strong></strong>

<title>Search </title>

</head>

<body>

<table align="center" width="1024" border="0">

  <tr>
    <td valign="top" align="center" width="70%" style="padding-top:10px;" class="lhc">


<div align="center" style="margin-top: 50px; padding-bottom: 50px;">
<?php 

$Keyword = $_POST['Keyword'];
$GuestName = $_POST['GuestName'];
$Day = $_POST['Day'];
$Month = $_POST['Month'];
$Year = $_POST['Year'];

  if(isset($cancel))
  {
    header("Location:index.php");
    exit;
  }

  $qry_string = "SELECT * FROM videos "; 
  $search = "";

  if(!empty($Keyword))

  {
    $End_String = "(Blurb LIKE '%$Keyword%' OR Title LIKE '%$Keyword%')";
    $search .="&Keyword=$Keyword";
  }

  if(!empty($GuestName))
  {
    if(isset($End_String))
    {
      $End_String .= " AND (GuestName LIKE '%$GuestName%')";
    }
    else
    {
      $End_String = "(GuestName LIKE '%$GuestName%')";
     }
    $search .="&GuestName=$GuestName";
  }

  if(!empty($Day))
    {
    if(isset($End_String))
    {
      $End_String .= " AND (DAYOFMONTH(Publish_Date) = '$Day')";
    }
    else
   {
     $End_String = "(DAYOFMONTH(Publish_Date) = '$Day')";
    }
    $search .="&Day=$Day";
  }

  if(!empty($Month))
  {
    if(isset($End_String))
  {
  $End_String .= " AND (MONTH(Publish_Date) = '$Month')";
   }
   else
   {
  $End_String = "(MONTH(Publish_Date) = '$Month')";
}
$search .="&Month=$Month";
  }

  if(!empty($Year))
  {
    if(isset($End_String))
  {
   $End_String .= " AND (YEAR(Publish_Date) = '$Year')";
}
else
{
  $End_String = "(YEAR(Publish_Date) = '$Year')";
}
$search .="&Year=$Year";
}

  if(!empty($Active))
  {
    if(isset($End_String))
    {
      $End_String .= " AND (GuestName LIKE '%$GuestName%')";
    }
    else
    {
      $End_String = "(GuestName LIKE '%$GuestName%')";
    }
    $search .="&GuestName=$GuestName";
   }

   if (!isset($offset)) $offset=0;

  if(isset($End_String))
  {
    $qry_string = $qry_string." WHERE ".$End_String . "ORDER BY Publish_Date DESC LIMIT $offset, 101";
  }
  else
  {
    $qry_string = $qry_string."ORDER BY Publish_Date DESC LIMIT $offset, 101";
  }

  $result = mysql_query($qry_string);
  echo mysql_error();
?>

And here is the code that displays the results from the database

<?php
  $num_records = mysql_num_rows($result);

  if (!isset($search))
        $search = "";
?>

 <table width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0"><tr><td>

 </td></tr></table>


  <table width="95%" align="center" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
    <tr>
      <td width=25%>
        <?php
          if ($offset > 99) {
            echo '<a href='.$_SERVER['PHP_SELF'].'?$offset='.($offset-100).'>Previous 100</a>';
          } else {
            echo 'Previous 100';
          }
        ?>
      </td>
      <td align=center width=10%>
        <span class="content1"><a href=search.php>Search </a></span>
      </td>
      <td align=right width=25%>
      <?php
        if($num_records == 101) {
         echo '<a href="'.$_SERVER['PHP_SELF'].'?offset='.($offset+100) .$search.'">Next 100</a>';
        } else {
          echo 'Next 100';
        }
      ?>
      </td>
    </tr>
  </table>

  <table align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#666666" style="margin: 5px 15px; 5px 10px;">
    <tr style="background: #9ae6f1; font-family: Verdana; font-weight: bold; font-size: 18px;">
      <td style="width: 65%; padding: 5px;">
        Video
    </td>
      <td align="center" style="width: 10%; padding: 5px;">
        Guest Name
      </td>
      <td align="center" style="width: 10%; padding: 5px;">
        Date
      </td>
    </tr>

  <?php
  $count = 1;
    $bgc = 1;
  while($row = mysql_fetch_array($result))
  {

    if ($count > 100) break;
    echo '<tr style="background: ';
        if (($bgc == 0 ? $bgc=1 : $bgc=0) == 0) echo "#FFFFFF";
        else echo "#E6E6E6";

    echo ';">';
    echo '<td><div style="padding: 3px;" class="content"><a href=../../watch/watch.php?ID='.$row[ID].'>'.$row[Title].'</a></div></td>';
    echo '<td><div style="padding: 3px;"     class="content">'.$row[GuestName].'</div></td>';
    echo '<td><div align="center" style="padding: 3px;"     class="content">'.$row[Publish_Date].'</div></td></tr>';
    $count++;
  }
  ?>

  </table>

  <table width="95%" align="center" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
    <tr>
      <td width=25%>
        <?php
          if($offset > 99) {

            echo '<span class="content"><a href='.$_SERVER['PHP_SELF'].'?offset='.($offset-100).$search.'>Previous 100</a></span>';
          } else {
            echo 'Previous 100';
          }
        ?>
      </td>
      <td align=center width=10%>
        <span class="content1"><a href=search.php>Search </a></span>
      </td>
      <td align=right width=25%>
      <?php
        if($num_records == 101) {
          echo '<span class="content"><a href='.$_SERVER['PHP_SELF'].'?offset='.($offset+100).$search.'>Next 100</a></span>';
        } else {
          echo 'Next 100';
        }
      ?>
      </td>
    </tr>
  </table>

Would really appreciate some help trying to figure this out or some points in the right direction. Thank you!