title: to show different rows per page after select option n php pagination?
body: <pre><code>$start_date = $_REQUEST['date1'];
  $end_date = $_REQUEST['date2'];
  $condition="1=1";
  if($start_date!="")
  $condition.=" AND event_date&gt;='".date( "Y-m-d", strtotime($start_date))."'";
  if($end_date!="")
  $condition.=" AND event_date&lt;='".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'])&gt;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 "&lt;table  width='100%'&gt;
  
     &lt;tr&gt;
       &lt;th&gt;&lt;code&gt;&lt;a href= 'index.php?page=".$_GET["page"]."&amp;date1=".$_GET["date1"]."&amp;date2=".$_GET["date2"].          "&amp;orderby=id&amp;dir=".$dir."'&gt;Id&lt;/code&gt;&lt;/th&gt;
       &lt;th&gt;&lt;a href= 'index.php?page=".$_GET["page"]."&amp;date1=".$_GET["date1"]."&amp;date2=".$_GET["date2"]."&amp;orderby=event_date&amp;dir=".$dir."'&gt;Event Date&lt;/a&gt;&lt;/th&gt;
       &lt;th&gt;&lt;a href= 'index.php?page=".$_GET["page"]."&amp;date1=".$_GET["date1"]."&amp;date2=".$_GET["date2"]."&amp;orderby=bdm_name&amp;dir=".$dir."'&gt;BDM Name&lt;/th&gt;
       &lt;th&gt;&lt;a href= 'index.php?page=".$_GET["page"]."&amp;date1=".$_GET["date1"]."&amp;date2=".$_GET["date2"]."&amp;orderby=event_type&amp;dir=".$dir."'&gt;Event Performed&lt;/th&gt;
       &lt;th&gt;&lt;a href= 'index.php?page=".$_GET["page"]."&amp;date1=".$_GET["date1"]."&amp;date2=".$_GET["date2"]."&amp;orderby=completed&amp;dir=".$dir."'&gt;Completed&lt;/th&gt;
     &lt;/tr&gt;";
  
  while($row = mysql_fetch_array($result))
      {
        echo "&lt;tr&gt;";
        echo "&lt;td&gt;" . $row['id'] . "&lt;/td&gt;";
        echo "&lt;td&gt;" . date( "m/d/Y", strtotime($row['event_date'])) . "&lt;/td&gt;";
        echo "&lt;td&gt;" . $row['bdm_name'] . "&lt;/td&gt;";
        echo "&lt;td&gt;" . $row['event_type'] . "&lt;/td&gt;";
        echo "&lt;td&gt;" . $row['completed'] . "&lt;/td&gt;";
        echo "&lt;/tr&gt;";
      }
   echo "&lt;/table&gt;";
  mysql_close($link);
  </code></pre>
  
  <p>Above code shows sql records in pagination only shows 30 rows per page because <code>$recordPerPage= '30';</code>.I want to create a selectbox in html having options from 30 to 100 rows and pass it to <code>$recordPerPage</code> so that when I select any option It will show the rows per page according to option selected. thanks in advance for help.</p>