<?php
 $kactane=3;
 $nerden=3;
 
        if(isset($_GET['satir']))
			$kactane=$_GET['satir'];
		
		if(isset($_GET['sn']))
			$nerden=$_GET['sn']* $kactane;
?>

<script type="text/javascript">
    function satirDegistir(veri){
		eleman=document.getElementsByName("linkler");
		
		for(var i=0; i<eleman.length; i++){	
             var linkdegeri =eleman[i].href;      		
		  eleman[i].href= linkdegeri.substr(0,linkdegeri.indexOf("&"))+"&satir="+veri.value;
		 /// alert(eleman[i].href);
		}
		
		
	}

</script>

Sayfada Görüntülenecek Satır Sayısı :
<select name="elemanSayisi" id="elemanSayisi" onchange=" satirDegistir(this)">
   <option value="2" <?php if($kactane==2) echo "selected"; ?> > 2 Satır</option>
   <option value="5"  <?php if($kactane==5) echo "selected"; ?> > 5 Satır</option>
   <option value="10"  <?php if($kactane==10) echo "selected"; ?> > 10 Satır</option>
   <option value="15"  <?php if($kactane==15) echo "selected"; ?> > 15 Satır</option>
   <option value="20"  <?php if($kactane==20) echo "selected"; ?> > 20 Satır</option>
   <option value="25"  <?php if($kactane==25) echo "selected"; ?> > 25 Satır</option>   

</select>
<br>
<br>

<?php


    $vt=@new mysqli("localhost","root","usbw","okulsistemi");
	
	if($vt->connect_error)
		die("<h1>Veritabanı Bağlantı Hatası");
	
	
	///sayfalama için eleman sayısını alalım
	$sql="SELECT COUNT(*) as 'top' FROM`kullanici`";
	$sorgu=$vt->prepare($sql);
	$sorgu->execute();
	
	$sonuc=$sorgu->get_result();
	$toplam_satir=$sonuc->fetch_assoc()['top'];
	
	
	
	
	$sql="SELECT * FROM `kullanici` LIMIT ? OFFSET ? ";
	$sorgu=$vt->prepare($sql);
	$sorgu->bind_param('ii',$kactane,$nerden);
	
	$sorgu->execute();
	
	$sonuc=$sorgu->get_result();
	
	
	 $metin="<style>
	         table{
				 border:2px solid red;
				 border-radius:10px;
                 font-family:arial;
   				 font-size:12pt;
			 }
			 
			 tr:hover{background-color:#AABBFF;}
	 </style>
	          <table border='0' cellpadding='10px'>
			     <tr>
				      <th>ID</th><th>Ad Soyad</th><th>Kullanıcı Adı</th><th>Kullanıcı Şifresi</th><th>Bölümü</th>
				 </tr>
	";
	
	while($veri=$sonuc->fetch_assoc())
		$metin.="
	       <tr>
		       <td>{$veri['id']}</td> <td>{$veri['adi']}</td><td>{$veri['kadi']}</td><td>{$veri['ksfr']}</td><td>{$veri['bolum']}</td>
		   </tr>
	";
		
		$metin.="
		      <tr>
			        <td colspan='6'> 
					";
					for($i=0;$i<($toplam_satir/$kactane);$i++)
						$metin.=" <a href='sayfalama.php?sn=$i&satir=$kactane'  name='linkler'  >".($i+1)."</a>";

 					
                  echo($metin."   
					</td>
			  </tr>
		
		<table>");
	
	$sorgu->close();
	$vt->close();




?>