```
$start_date = $_REQUEST['date1'];
$end_date = $_REQUEST['date2'];
$condition="1=1";
if($start_date!="")
$condition.=" AND event_date>='".date( "Y-m-d", strtotime($start_date))."'";
if($end_date!="")
$condition.=" AND event_date<='".date( "Y-m-d", strtotime($end_date))."'";
$start_date = date( "Y-m-d", strtotime($start_date)); 
$end_date = date( "Y-m-d", strtotime($end_date));
$link = mysql_connect('localhost', 'username', 'password');

if (!$link) 
 {
die('Could not connect: ' . mysql_error());
}
if($_REQUEST["dir"]=="" || $_REQUEST["dir"]=="desc")
$dir="asc";
else
    $dir="desc";

  if($_REQUEST["orderby"]!="")$ord = " ORDER BY ".$_REQUEST["orderby"];
  if($_REQUEST["dir"]!="")$ord .= " ".$_REQUEST["dir"];

 mysql_select_db("intern_db", $link);

$page = (intval($_GET['page'])>0) ? $_GET['page'] : 1;
$recordPerPage= '30';
$startPoint = ($page - 1)*$recordPerPage;
$result = mysql_query("SELECT count(*) cnt FROM ` admin_crmf_poc_event_history` where $condition");
        $row = mysql_fetch_array($result);
        $num_rows = $row["cnt"];

$result = mysql_query("SELECT * FROM ` admin_crmf_poc_event_history` where $condition $ord LIMIT $startPoint,$recordPerPage");
        $totalPages=ceil($num_rows/$recordPerPage);

if(!$totalPages){
   echo "There is no record.";
}
else{
   echo "$recordPerPage records are shown.";

   }
 echo "<table  width='100%'>

   <tr>
     <th><code><a href= 'index.php?page=".$_GET["page"]."&date1=".$_GET["date1"]."&date2=".$_GET["date2"].          "&orderby=id&dir=".$dir."'>Id</code></th>
     <th><a href= 'index.php?page=".$_GET["page"]."&date1=".$_GET["date1"]."&date2=".$_GET["date2"]."&orderby=event_date&dir=".$dir."'>Event Date</a></th>
     <th><a href= 'index.php?page=".$_GET["page"]."&date1=".$_GET["date1"]."&date2=".$_GET["date2"]."&orderby=bdm_name&dir=".$dir."'>BDM Name</th>
     <th><a href= 'index.php?page=".$_GET["page"]."&date1=".$_GET["date1"]."&date2=".$_GET["date2"]."&orderby=event_type&dir=".$dir."'>Event Performed</th>
     <th><a href= 'index.php?page=".$_GET["page"]."&date1=".$_GET["date1"]."&date2=".$_GET["date2"]."&orderby=completed&dir=".$dir."'>Completed</th>
   </tr>";

while($row = mysql_fetch_array($result))
    {
      echo "<tr>";
      echo "<td>" . $row['id'] . "</td>";
      echo "<td>" . date( "m/d/Y", strtotime($row['event_date'])) . "</td>";
      echo "<td>" . $row['bdm_name'] . "</td>";
      echo "<td>" . $row['event_type'] . "</td>";
      echo "<td>" . $row['completed'] . "</td>";
      echo "</tr>";
    }
 echo "</table>";
mysql_close($link);

```

Above code shows sql records in pagination only shows 30 rows per page because `$recordPerPage= '30';`.I want to create a selectbox in html having options from 30 to 100 rows and pass it to `$recordPerPage` so that when I select any option It will show the rows per page according to option selected. thanks in advance for help.