-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
|
||
?> |