//链接数据库'查询
mysql_connect('localhost','username','userpwd')or die("数据库链接失败".mysql_error());
mysql_select_db('库名');
mysql_query('set names utf8');
$sql1="select * from user ";
$query1=mysql_query($sql1);
$count=array();
while($row=mysql_fetch_assoc($query1)){
$count[]=$row;
}
$totalnews=count($count);
//判断page
if($_GET['page']){
$page=$_GET['page'];
}else{
$page=1;
}
$start=($page-1)*$newnum;
$sql="select * from user limit $start,$newnum";
$query=mysql_query($sql);
$ret=array();
while($row=mysql_fetch_assoc($query)){
$ret[]=$row;
}
?>
//表格样式