CodeIgniter Forums
Mysql queries sometimes appear sometimes disappear - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Mysql queries sometimes appear sometimes disappear (/showthread.php?tid=77553)



Mysql queries sometimes appear sometimes disappear - adamfr28 - 09-16-2020

Hello! I have a problem when displaying data on the main page, which sometimes appears and disappears. Like this :

[Image: lSmYB.png]

This is the code index.php :

Code:
<?php
include_once 'function/core.php';
$hdr = select('nama_kehadiran, warna', 'tbl_kehadiran');

$cekmgg = date("d");
$xyz = $cekmgg%2;
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Jadwal Hari ini</title>
  </head>
  <link rel="stylesheet" href="<?= base('assets/css/style.css'); ?>" media="screen" title="no title">
  <link rel="stylesheet" href="<?= base('assets/css/bootstrap.css'); ?>" media="screen" title="no title">
  <link rel="stylesheet" href="<?= base('assets/jquery.simplyscroll/jquery.simplyscroll.css'); ?>" media="screen" title="no title">
  <link rel="shrotcut icon" href="<?= base('images/favicon.png'); ?>">
  <script type="text/javascript" src="<?= base('assets/js/jquery.js'); ?>"></script>
  <script type="text/javascript" src="<?= base('assets/js/bootstrap.min.js'); ?>"></script>
  <script type="text/javascript" src="<?= base('assets/jquery.simplyscroll/jquery.simplyscroll.min.js'); ?>"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $("#scroller").simplyScroll({
        customClass: 'simply-scroll',
        frameRate: 15,
        speed: 10,
        pauseOnHover: false,
        orientation:'vertical',
        customClass:'vert'
      });
    });
  </script>
  <body style="background:url('images/pattern.png');background-attachment:fixed;">
    <nav class="navbar navbar-default navbar-fixed-top" style="background:#109618 !important;color:#fff !important;box-shadow: 0px 0px 5px #222;">
      <div class="container">
        <div class="navbar-header">
          <a href="#" class="navbar-brand"><img src="<?= base('images/main-logo.png'); ?>" width="175px" alt="" class="img img-responsive"></a>
        </div> <!-- end of class navbar-header -->
        <div class="collapse navbar-collapse navbar-right">
          <ul class="nav navbar-nav">
            <li>
              <h4 style="padding-top:7px;margin-right:-80px;">
                <?php
                $hari = date('w');
                $tgl    = date('Y-m-d');
                echo hari($hari).', '.tglskrg($tgl); ?>
              </h4>
            </li>
          </ul>
        </div> <!-- end of class collapse -->
      </div> <!-- end of class container -->
    </nav>

    <div class="container-fluid" id="main-content">
        <div class="row">
          <div class="col-md-9" style="background-image: url('images/pattern.png') !important;padding-right: 0px;padding-left: 5px;">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th class="ctr" width="120px">Jam</th>
                  <th class="ctr" width="275px">Guru</th>
                  <th class="ctr" width="400px">Mata Pelajaran</th>
                  <th class="ctr">Kelas</th>
                  <th class="ctr">Ket.</th>
                </tr>
              </thead>
            </table>
            <hr>
            <ul id="scroller">
              <li>
                <?php include 'templates/content.php'; ?>
              </li>
            </ul>
          </div>
          <div class="col-md-3" style="padding-right: 5px;">
            <div class="panel panel-primary">
              <div class="panel-heading">
                Pengumuman
              </div>
              <div class="panel-body">
                <?php
                  $annc = select('*','tbl_lain', "id=1 LIMIT 1");
                  $p = mysqli_fetch_assoc($annc);
                  echo $p['isi'];
                ?>
              </div> <!-- end of class panel-body -->
            </div> <!-- end of class panel-primary -->
            <hr>

            <div class="panel panel-primary">
              <div class="panel-heading">
                Keterangan :
              </div>
              <div class="panel-body">
                <table class="table">

                <?php while ($hd = mysqli_fetch_assoc($hdr)) : ?>

                  <tr>
                    <td>
                      <div style="width:30px;height:30px;background:#<?= $hd['warna'];?>"></div>
                    </td>
                    <td>:</td>
                    <td><?= $hd['nama_kehadiran']; ?></td>
                  </tr>

                <?php endwhile; ?>

                </table>
              </div>
            </div>
          </div> <!-- end of class col-md-3 -->
        </div> <!-- end of class row -->
    </div> <!-- end of class container or ID main-content -->

<?php include_once 'templates/footer.php'; ?>

What is the problem and how to solve it? Thank you in advance.


RE: Mysql queries sometimes appear sometimes disappear - php_rocs - 09-16-2020

@adamfr28,

Are you seeing any error messages? In the console?


RE: Mysql queries sometimes appear sometimes disappear - InsiteFX - 09-16-2020

You should also move your JavaScript to the end of your html just above </body> </html>
for faster page loading.

As @php_rocs states you can hit the F-12 key in your web browser to bring up the developer
tools then make sure it's on the console tab.


RE: Mysql queries sometimes appear sometimes disappear - adamfr28 - 09-16-2020

(09-16-2020, 12:37 PM)php_rocs Wrote: @adamfr28,

Are you seeing any error messages? In the console?
No errors.