Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
arkafauzi authored Jan 23, 2024
1 parent 6c446e3 commit 6267489
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
43 changes: 43 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
include 'koneksi.php';
?>

<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/dataTables.bootstrap5.min.css">
</head>
<body>
<table id="example" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>No</th>
<th>Nis</th>
<th>Nama Siswa</th>
<th>Jenis Kelamin</th>
</tr>
</thead>
<tbody>
<?php
$no=1;
$data=mysqli_query($db, "SELECT nis, nama, jenis_kelamin from siswa ");
while($siswa = mysqli_fetch_array($data)){
?>
<tr>
<td>
<?php echo $no++; ?></td>
<td><?php echo $siswa['nis'];?></td>
<td><?php echo $siswa['nama'];?></td>
<td><?php echo $siswa['jenis_kelamin'];?></td>
</tr>
<?php
} ?>
</tbody>
<!-- sc link js-->
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.7/js/dataTables.bootstrap5.min.js"></script>
<script src="js/app.js"></script>
<!-- penutup js -->
</body>
</html>
14 changes: 14 additions & 0 deletions koneksi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

$server = "localhost";
$user = "root";
$password = "";
$nama_database = "db_siswa";

$db = mysqli_connect($server, $user, $password, $nama_database);

if( !$db){
die("Gagal terhubung dengan database: " . mysqli_connect_error());
}

?>

0 comments on commit 6267489

Please sign in to comment.