-1

Severity: Parsing Error
Message: syntax error, unexpected '}'
Filename: siswa/nilai_siswa.php

This is my code php

 <?php $this->load->view('siswa/header')?> <div class="shortcodes">
    <div class="container">         <div class="page">  <table class="table">
       <thead>
         <tr>
           <th>No</th>
          <th>Nama Mata Pelajaran</th>
           <th>Nilai Tugas</th>
           <th>Nilai UTS</th>
           <th>Nilai UAS</th>
          <th>Nilai Akhir</th>
         </tr>
       </thead>
       <tbody>
         <?php      $no=1;      foreach ($siswa->result() as $field){?>         <tr class="active">             <th scope='row'><?php echo $no?></th>           <td><?php
 echo $field->nama_mapel?></td>             <td><?php echo
 $field->tugas?></td>               <td><?php echo $field->uts?></td>   
            <td><?php echo $field->uas?></td>               <td><?php echo
 $field->nilai_akhir?></td>         </tr>
                </br>       <?php       $no++;      }       ?>
       </tbody>
     </table>       <?php}  else    {   
            echo"";     }   ?>

          </div>     </div> </div> <?php $this->load->view('siswa/footer')?>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

3 Answers3

1

I looks like you have an else in your code (after your table) but I don't see if. You have a missing if condition or a empty else.

0

it's always good to attach whole error message at it usually states at which line error occurred.

I can see a problem just after the foreach statement - you are closing php section and the trying to perform echo - outside of php section.

Then at the line where you close the you try to close the block with curly there is no block opened that should be closed with it - that's probably the line of an error. Please make sure that all closing brackets meet their opening ones.

Good luck with further development !

Jacek Lawniczak
  • 256
  • 1
  • 5
0

Remove this part:

<?php } else { echo""; }   ?>

or add something like this

 <?php if(XXXXX == XXXXX) { ?>

in your code before.

Oliver
  • 893
  • 6
  • 17