-3

// here i m trying read data from database but it show Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\primarypro\index.php on line 87. i m checked three time but i did not find anything wrong . please help finding error or solution to this problem,

 <?php include "inc/header.php"; ?>
<?php
spl_autoload_register(function ($class){

    include"classes/".$class.".php";
});



?>
<?php
$user = new student();

?>


<section class="mainleft">
<form action="" method="post">
 <table>
    <tr>
        <td>Name: </td>
        <td><input type="text" name="name" required="1"/></td>    
    </tr>

    <tr>
       <td>Department: </td>
        <td><input type="text" name="name" required="1"/></td>
    </tr>

    <tr>
      <td>Age: </td>
        <td><input type="text" name="name" required="1"/></td>
    </tr>
    <tr>
      <td></td>
        <td>
        <input type="submit" name="submit" value="Submit"/>
        <input type="reset" value="Clear"/>
        </td>
    </tr>
  </table>
</form>
</section>



<section class="mainright">
  <table class="tblone">
    <tr>
        <th>No</th>
        <th>Name</th>
        <th>Department</th>
        <th>Age</th>
        <th>Action</th>
    </tr>

      <?php

      $i=0;
      foreach($user->readAll() as $key => $value){
          $i++;



   ?>



    <tr>
        <td><?php echo $i;?></td>
        <td><?php echo $value['name']; ?></td>
        <td><?php echo $value['dept']; ?></td>
        <td><?php echo $value['age']; ?></td>
        <td>
        <a href="">Edit</a> ||
        <a href="">Delete</a>
        </td>
    </tr>
<?php}?>

  </table>
</section>

<?php include "inc/footer.php"; ?>
chris85
  • 23,846
  • 7
  • 34
  • 51
Golam Rabbani
  • 55
  • 1
  • 7

2 Answers2

1

Not quite sure which is line 87 on your code but i think the problem is

<?php}?>

which should be

<?php } ?>
huydq5000
  • 274
  • 1
  • 8
0

Try with this one

<?php include "inc/header.php"; ?>
   spl_autoload_register(function ($class){

    include"classes/".$class.".php";
});

$user = new student();

?>


<section class="mainleft">
<form action="" method="post">
 <table>
    <tr>
        <td>Name: </td>
        <td><input type="text" name="name" required="1"/></td>    
    </tr>

    <tr>
       <td>Department: </td>
        <td><input type="text" name="name" required="1"/></td>
    </tr>

    <tr>
      <td>Age: </td>
        <td><input type="text" name="name" required="1"/></td>
    </tr>
    <tr>
      <td></td>
        <td>
        <input type="submit" name="submit" value="Submit"/>
        <input type="reset" value="Clear"/>
        </td>
    </tr>
  </table>
</form>
</section>



<section class="mainright">
  <table class="tblone">
    <tr>
        <th>No</th>
        <th>Name</th>
        <th>Department</th>
        <th>Age</th>
        <th>Action</th>
    </tr>

      <?php

      $i=0;
      foreach($user->readAll() as $key => $value){
          $i++;



   ?>



    <tr>
        <td><?php echo $i;?></td>
        <td><?php echo $value['name']; ?></td>
        <td><?php echo $value['dept']; ?></td>
        <td><?php echo $value['age']; ?></td>
        <td>
        <a href="">Edit</a> ||
        <a href="">Delete</a>
        </td>
    </tr>
<?php } ?>

  </table>
</section>

<?php include("inc/footer.php"); ?>
Bug Inspector
  • 301
  • 4
  • 15