include("../function/sessioncheck.php");
include("../function/connectdb.php");
include("../function/valuecheck.php");
include("../function/userdatacheck.php");
include("../function/config.php");
//確認當前頁
if (isset($_GET['page'])){
$page1=$_GET['page'];
}else{
$page1=1;
}
if($page1<=0){
$page1=1;
}
//查詢資料表內部不重複的資料(以loginname,username,email為準
$sql1="select distinct loginname,username,grade,email from labmember order by loginname";
//取得完整的不重複的資料
$result1=mysqli_query($link,$sql1);
//計算取得完整的不重複的資料個數,即代表實驗室成員個數
$uniqueresult1total=mysqli_num_rows($result1);
//每一頁一次要顯示多少筆資料
$viewtotal=5;
//計算總頁數
if($uniqueresult1total==0){
$totalpage=0;
}else{
$totalpage=ceil($uniqueresult1total/$viewtotal);
}
//計算當前讀到第幾筆資料
$begin=($page1-1)*$viewtotal;
//從資料庫抓出要顯示的資料(無關資料的流水號
$sql2=$sql1." limit ".$begin.",".$viewtotal."";
$result2=mysqli_query($link,$sql2);//讀取資料
?>