Home > Backend Development > PHP Tutorial > empty貌似跟isset有区别?看以下代码解决方案

empty貌似跟isset有区别?看以下代码解决方案

WBOY
Release: 2016-06-13 10:15:45
Original
1088 people have browsed it

empty貌似跟isset有区别?看以下代码





//显示所有用户的信息(表格)
//查询数据
$conn=mysql_connect("localhost","root","5200") or die(mysql_error());

//设置mysql的编码

mysql_query("set names utf-8",$conn);
//选择数据库

mysql_select_db("manage",$conn) or die(mysql_error());

$pageSize=3;//每一页记录数
$rowCount=0;

if(!empty($_GET['pageNow'])){
$pageNow=1;
}
else{
$pageNow=$_GET['pageNow'];
}

$sql="select count(id) from emp";
$res1=mysql_query($sql);
if($row=mysql_fetch_row($res1)){
$rowCount=$row[0];//rowCount为数据记录数量
}
//计算多少页
$pageCount=ceil($rowCount/$pageSize);
$sql="select * from emp limit ".($pageNow-1)*$pageSize.",$pageSize";

$res2=mysql_query($sql,$conn);
//$sql="select * from emp";


echo "

雇员信息表

";
echo "";
echo "";

while($row=mysql_fetch_assoc($res2)){
echo "".
"".
"";
}
echo "
id name grade email slary 修改用户 删除用户
{$row['id']} {$row['name']} {$row['grade']}{$row['email']} {$row['salary']}删除用户 修改用户
";
//打印页码的超链接
for($i=1;$i{
echo "$i";
}

?>



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template