nehaperiyasamy Ответов: 1

Неопределенный индекс: год в C:\xampp\htdocs\cecri karikudi\stu_attendance.php на линии 60


<?php
@ob_start();
session_start();
?>	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CECRI KARAIKUDI</title>
<?php
include('css.php');
?>
</head>
<body>
<div class="row" align="center"><a href="index.php"><img src="img/header.png" class="img img-responsive" alt="" align="center" /></div><div class="clear_fix"></div>

<!-- Start Content -->
	<div class="clearfix"></div>
<div class="row strip">
	  <a href="index.php"><span class="strip_font">Home</span></a> / <a class="active" href=""><span class="strip_font" style="color:#C00;">Attendance</span></a>
</div>
<div class="clearfix"></div>


<div class="col-md-12">
<div class="col-md-3 col-sm-3 col-xs-12">
  <div class="left_side_menu">
	<?php
	 include('db.php');
     include('stu_menu.php');
	 if(isset($_SESSION['roll_no'])){
		$roll = $_SESSION['roll_no'];
    ?>
  </div>
</div>
<div class="col-md-9 col-sm-9 col-xs-12 content_border" style="margin-top:10px; padding:0px 10px 10px;">
  
  <h3 style="font-weight:bold; text-transform:uppercase; padding-bottom:5px;">Monthly Attendance Report</h3>
  <?php
        $query = $db->query("select * from stu_atten where roll_no='$roll'") or die(mysqli_error());
    ?>
  <table class="table table-bordered table-responsive">
        <tr>
            <th>Student Roll No.</th>
            <th>Student Name</th>
            <th>Class</th>
            <th>Year</th>
            <th>Month</th>
            <th>No. Of Days Present</th>
            <th>No. Of Working Days</th>
        </tr>
        <?php
        while($row = mysqli_fetch_assoc($query)){  
        ?>
        <tr>	
            <td><center><?php echo $row['roll_no']; ?></center></td>
            <td><center><?php echo $row['name']; ?></center></td>
            <td><center><?php echo $row['class']; ?></center></td>
            <td><center><?php echo $row['year']; ?></center></td>
            <td><center><?php echo $row['month']; ?></center></td>
            <td><center><?php echo $row['present_days']; ?></center></td>
            <td><center><?php echo $row['work_days']; ?></center></td>
        </tr>
        <?php } ?>
    </table>
  
<?php
	} else{		
		header('location:index.php?suc=suc');	
	}
?>

    </div>
    
</div>

<!-- End Content -->

<?php
include('footer.php');
?>
</body>
</html>


Что я уже пробовал:

<?php
error_reporting();
$db = new mysqli('localhost', 'root', '', 'cecri karaikudi');
if($db->connect_errno){
	die('Sorry Database not connected !!!');
}
?>

1 Ответов

Рейтинг:
2

Richard MacCutchan

В вашем коде нет переменной с именем "year".