Query select tidak muncul / berjalan padahal data masuk dbase

Permisi agan agan, mau nanya nih. Terkait system informasi yang saya bikin untuk menampilkan jumlah audiens hari ini bagi yang akhwat jalan tapi kok bagi yang ikhwan tidak jalan yaa?

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Siham Management System</title>
    <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="bootstrap/css/animate.css">
  	<script type="text/javascript" src="bootstrap/js/jquery-3.4.1.slim.min.js"></script>
  	<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>

    <!-- custom font -->
    <style>
      @font-face {
          font-family: monserrat-bold;
          src:url("Montserrat-Bold.ttf");
      }

      @font-face {
        font-family: quicksand-book;
        src:url("Quicksand_Book.otf");
      }

      @font-face {
          font-family: monserrat-med;
          src:url("Montserrat-Medium.ttf");
      }

      .monserrat-b{
          font-family: monserrat-bold;
      }

      .monserrat-m{
          font-family: monserrat-med;
      }

      .quicksand-r{
          font-family: quicksand-book;
      }
      .jumbotron{
          background-image: url("http://localhost/Siham/img/buku.svg");
          background-color: white;
          background-size: cover;
          min-height: 500px;
      }
    </style>

  </head>
  <body>
    <?php
     //error_reporting(0);
      if ($_GET['sukses_nis']) {
        include 'koneksi.php';
        $get = $_GET['sukses_nis'];
        $namanya = mysqli_query($koneksi, "SELECT nama_lengkap FROM rekap WHERE nis = '".$get."'");
        echo "<!-- Modal -->
        <div class='modal fade animated bounceIn text-center monserrat-m' id='notif' tabindex='-1' role='dialog' aria-labelledby='exampleModalCenterTitle' aria-hidden='true'  style='padding-top:100px;'>
          <div class='modal-dialog modal-sm' role='document'>
            <div class='modal-content'>
              <div class='modal-body'>
                <img class='img-fluid m-2 animated bounceIn' src='http://localhost/Siham/img/success2.png' alt='Upss ada kesalahan'>
                <h5 class='m-3'><b>Selamat datang, ";while($datanya = mysqli_fetch_assoc($namanya)) {
                  echo ucfirst($datanya['nama_lengkap']);
                };echo "</b></h5>
                <p>Selamat belajar di majelis Hamasah, semoga bermanfaat</p>
                <button type='button' class='btn w-100 p-3 mt-3 mb-2 font-weight-bold rounded-pill' data-dismiss='modal' style='background-image: linear-gradient(to right, #27ae60 , #2ed573); color:white;'>Asiyapp</button>
              </div>
            </div>
          </div>
        </div>";
      }
    ?>
    <div class="jumbotron jumbotron-fluid">
      <div class="container-fluid ml-3 quicksand-r">
        <!-- form login start -->
        <br><br><br>
        <h1 class="monserrat-b animated infinite bounce">Get in touch to NGAJI !</h1>
        <br>
        <form class="form-inline" action="loginin0.php" method="get">
          <strong><div class="form-row align-items-center font-weight-bold" style="font-size : 20px;">
            <div class="col-auto">
              <input type="text" name="siswa_nis" class="form-control mb-2 " id="setnis" placeholder="Masukkan NIS Anda">
            </div>
            <div class="col-auto">
              <input type="submit" name="login" class="btn btn-success mb-2 " value="Masuk">
            </div>
          </div></strong>
        </form>
        <p class="font-weight-bold"><span>Baru di HM ?</span><a href="daftar1.php" class="btn btn-link animated infinite "> Daftar Yuk!</a></p>
        <br>
        <br>
        <!-- form login end -->
      </div>
    </div>
    <div class="container-fluid" style="margin-top : 20px;">

      <h3 class="monserrat-m">Recent Logged In</h3>

      <!-- ini tab nya -->
      <ul class="nav nav-tabs nav-justified monserrat-m" role="tablist">
        <li class="nav-item">
          <a class="nav-link active" href="#tabikhwan" role="tab" data-toggle="tab"><strong>Ikhwan</strong></a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#tabakhwat" role="tab" data-toggle="tab"><strong>Akhwat</strong></a>
        </li>
      </ul>
      <!-- Tab panes -->
      <div class="tab-content monserrat-m">

        <!-- tab ikhwan start -->
        <div role="tabpanel" class="tab-pane active in" id="tabikhwan">
          <div class="borderku-ungu shadow-sm pl-3 mb-3 mt-4 bg-white rounded">
            <?php
            include 'koneksi.php';
            date_default_timezone_set("Asia/Jakarta");
            $waktu = date("l, d - F - Y");
            $waktu2 = date("D, d-M-Y");
            $sqlall = "SELECT nama_lengkap FROM rekap";
            $sqlhadir = "SELECT nama_lengkap FROM rekap WHERE recent = '".$waktu2."'";
            $total = mysqli_query($koneksi, $sqlall);
            $hadir = mysqli_query($koneksi, $sqlhadir);
            echo "<br>Hari ini :  ".$waktu."<br/>";
            echo "<br>Audiens hari ini :  ".mysqli_num_rows($hadir)." / ".mysqli_num_rows($total)."<br/><br/>";
            ?>
          </div>
          <div class="table-responsive shadowku p-3 mb-5 bg-white rounded">
            <table class="table table-hover" cellspacing="0" cellpadding="10">
              <thead class="thead-light">
                <th>Nama</th>
                <th>Kelas</th>
              </thead>
              <tbody>
                <?php
                date_default_timezone_set("Asia/Jakarta");
                $waktu = date("D, d-M-Y");
                $sql = "SELECT nama_lengkap, kelas FROM ikhwan WHERE recent = '".$waktu."' GROUP BY kelas ASC";
                $kueri = mysqli_query($koneksi, $sql);

                if ($kueri) {
                  while ($data = mysqli_fetch_array($kueri)) {

                  ?>
                    <tr>
                      <td><?php echo ucfirst($data['nama_lengkap']); ?></td>
                      <td><?php echo $data['kelas']; ?></td>
                    </tr>
                  <?php }?>
                <?php } else {
                  echo "konek error : ".mysqli_error($koneksi);
                } $sql1 = "SELECT nama_lengkap FROM ikhwan";
                $total = mysqli_query($koneksi, $sql1);
                echo "</tbody><caption><code>Peserta hadir : ".mysqli_num_rows($kueri)." / ".mysqli_num_rows($total)."</code></caption></table><br/>";
                mysqli_close($koneksi); ?>
                <a href="eksporikhwan.php" class="btn btn-success mb-2">Simpan sebagai EXCEL</a>
          </div>
        </div>

        <!-- tab akhwat start -->
        <div role="tabpanel" class="tab-pane fade" id="tabakhwat">
          <div class="borderku-ungu shadow-sm pl-3 mb-3 mt-4 bg-white rounded">
            <?php
            date_default_timezone_set("Asia/Jakarta");
            $waktu = date("l, d - F - Y");
            echo "<br>Hari ini : ".$waktu."<br/><br/>";
            ?>
          </div>
          <div class="table-responsive shadowku p-3 mb-5 bg-white rounded">
            <table class="table table-hover" cellspacing="0" cellpadding="10">
              <thead class="thead-light">
                <th>Nama</th>
                <th>Kelas</th>
              </thead>
              <tbody>
                <?php
                include 'koneksi.php';
                date_default_timezone_set("Asia/Jakarta");
                $waktu = date("D, d-M-Y");
                $sql = "SELECT nama_lengkap, kelas FROM akhwat WHERE recent = '".$waktu."' GROUP BY kelas ASC";
                $kueri = mysqli_query($koneksi, $sql);

                if ($kueri) {
                  while ($data = mysqli_fetch_array($kueri)) {

                  ?>
                    <tr>
                      <td><?php echo ucfirst($data['nama_lengkap']); ?></td>
                      <td><?php echo $data['kelas']; ?></td>
                    </tr>
                  <?php }?>
                <?php } else {
                  echo "konek error : ".mysqli_error($koneksi);
                }$sql2 = "SELECT nama_lengkap FROM akhwat";
                $total = mysqli_query($koneksi, $sql2);
                echo "</tbody><caption><code>Peserta hadir : ".mysqli_num_rows($kueri)." / ".mysqli_num_rows($total)."</code></caption></table><br/>";
                mysqli_close($koneksi); ?>
                <a href="eksporakhwat.php" class="btn btn-success mb-2">Simpan sebagai EXCEL</a>
          </div>
        </div>
      </div>
    </div>
    <script>
    $(document).ready(function(){
        $("#notif").modal('show');
    });
    </script>
  </body>
</html>

Jadi harusnya di homepage itu table ikhwan yang hadir hari ini siapa aja itu tercantum sesuai statement query query pada ikhwan di atas. Dugaan saya sih ada di statement yang ini nih,

<div class="table-responsive shadowku p-3 mb-5 bg-white rounded">
            <table class="table table-hover" cellspacing="0" cellpadding="10">
              <thead class="thead-light">
                <th>Nama</th>
                <th>Kelas</th>
              </thead>
              <tbody>
                <?php
                date_default_timezone_set("Asia/Jakarta");
                $waktu = date("D, d-M-Y");
                $sql = "SELECT nama_lengkap, kelas FROM ikhwan WHERE recent = '".$waktu."' GROUP BY kelas ASC";
                $kueri = mysqli_query($koneksi, $sql);

                if ($kueri) {
                  while ($data = mysqli_fetch_array($kueri)) {

                  ?>
                    <tr>
                      <td><?php echo ucfirst($data['nama_lengkap']); ?></td>
                      <td><?php echo $data['kelas']; ?></td>
                    </tr>
                  <?php }?>
                <?php } else {
                  echo "konek error : ".mysqli_error($koneksi);
                } $sql1 = "SELECT nama_lengkap FROM ikhwan";
                $total = mysqli_query($koneksi, $sql1);
                echo "</tbody><caption><code>Peserta hadir : ".mysqli_num_rows($kueri)." / ".mysqli_num_rows($total)."</code></caption></table><br/>";
                mysqli_close($koneksi); ?>
                <a href="eksporikhwan.php" class="btn btn-success mb-2">Simpan sebagai EXCEL</a>
          </div>
        </div>

Itu kenapa yaa? Kira kira adakah kesalahan dalam statement yang saya duga tersebut?Terima kasih banyak

avatar Sukaboneka
@Sukaboneka

24 Kontribusi 0 Poin

Dipost 4 tahun yang lalu

Tanggapan

Coba kamu die dump di querynya, ada hasilnya atau ngga..

1 Jawaban:

gimana kak caranya?

avatar Sukaboneka
@Sukaboneka

24 Kontribusi 0 Poin

Dipost 4 tahun yang lalu

Login untuk ikut Jawaban