my datatables didn't work and i get console error Uncaught TypeError: Cannot set property '_DT_CellIndex' of undefined but when i delete the query inside tbody its working fine.
<table class="table table-bordered table-striped table-fixed text-center" id="myTable">
                <thead>
                  <tr>
                    <th>No</th>
                    <th>ID</th>
                    <th>Nama</th>
                    <th>Golongan</th>
                    <th>Nilai Output</th>
                    <th>Penilaian Atasan</th>
                    <th>Nilai Learning</th>
                    <th>Nilai Kedisiplinan</th>
                    <th>Nilai 5R</th>
                    <th>Hasil</th>
                    <th>Tanggal</th>
                  </tr>
                </thead>
                  <!-- query -->
                  <?php
                  $no = 0;
                  $query = "SELECT * FROM user 
                            where id= $_SESSION[id]";
                  $query = "SELECT user.id,user.nama,golongan,nilai_output,nilai_atasan,nilai_learning,nilai_kedisiplinan,nilai_5r,overall,tanggal 
                            FROM tkaryawan 
                            JOIN user 
                            ON user.id=tkaryawan.id 
                            where user.id= $_SESSION[id] 
                            ORDER BY tanggal DESC";
                  $result = mysqli_query($koneksi, $query);
                  
                  if(!$result){
                    die ("Query Error: ".mysqli_errno($koneksi).
                    " - ".mysqli_error($koneksi));
                  }
                  while($data = mysqli_fetch_assoc($result))
                  {
                    $no++;
                    ?>
                  <tbody>
                    <tr>
                      <td><?php echo $no;?></td>
                      <td><?php echo $data['id'];?></td>
                      <td class="text-capitalize"><?php echo $data['nama'];?></td>
                      <td><?php echo $data['golongan'];?></td>
                      <td><?php echo $data['nilai_output'];?></td>
                      <td><?php echo $data['nilai_atasan'];?></td>
                      <td><?php echo $data['nilai_learning'];?></td>
                      <td><?php echo $data['nilai_kedisiplinan'];?></td>
                      <td><?php echo $data['nilai_5r'];?></td>
                      <td class="font-weight-bold text-danger"><?php echo $data['overall'];?></td>
                      <td class="text-secondary"><?php echo $data['tanggal'];?></td>
                    <tr>
                  </tbody>
                  <?php
                  }
                  // free the memory 
                  mysqli_free_result($result);
                  // close conection
                  mysqli_close($koneksi);
                  ?>
              </table>
appreciate any help you can provide.
EDITED
          <?php
          $stmt = $mysqli->prepare("SELECT id,nama FROM user WHERE user.id= $_SESSION[id]");
          $stmt->execute();
          $res = $stmt->get_result();
          $row = $res->fetch_assoc();
          if(!$row){
            mysqli_query($link, $sql);
          }
          else
          {
          echo "<h3 class='text-uppercase'>HASIL KINERJA </br> <p class='font-weight-bold text-danger'> $row[nama] </p> </h3>";
          }
          ?>
 
    