我认为这是一个愚蠢的问题,但对不起我是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 dataRoll NO | Student Name | Father Name | Class | Class Section | Phone number | Email Address | Address | Edit | View Fees | Attendance |
---|
$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}
?>
请阅读我的代码并指导我如何显示我的消息再次感谢您