php如何提示没有数据,如果表中没有数据,如何在php中显示消息

我认为这是一个愚蠢的问题,但对不起我是php的问题,实际上我想显示消息,如果我没有表中的数据,那我该怎么办.我的代码在这里先谢谢你

error_reporting(0);

include("connection.php");

session_start();

if(!($_SESSION['email']))

{

echo "please login first to access this page";

header("refresh:3;url=index.php");

exit();

}

?>

body

{

margin: 0;

padding: 0;

}

table

{

border-collapse: collapse;

width: 100%;

font-family: sans-serif;

font-size: 15px;

}

th,td

{

padding: 5px;

text-align: left;

}

tr:nth-child(even)

{

background: #edf0f5;

}

th

{

background: #00A800;

color: white;

padding: 5px;

font-family: sans-serif;

}

a

{

text-decoration: none;

color: #00A800;

}

a:hover

{

text-decoration: underline;

}

View all the data
Roll NOStudent NameFather NameClassClass SectionPhone numberEmail AddressAddressEditView FeesAttendance

$select="select *from student where class='1' AND section='B' ";

$run=mysqli_query($con,$select);

$i=0;

while($row=mysqli_fetch_array($run))

{

$id=$row['id'];

$s_name=$row['s_name'];

$f_name=$row['f_name'];

$class=$row['class'];

$section=$row['section'];

$phone=$row['phone'];

$email=$row['email'];

$address=$row['address'];

$i++;

?>

<?php echo $i;?><?php echo $s_name;?><?php echo $f_name;?><?php echo $class;?><?php echo $section;?><?php echo $phone;?><?php echo $email;?><?php echo $address;?> Edit Fees Attendance

}

?>

请阅读我的代码并指导我如何显示我的消息再次感谢您

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值