Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<html lang="en">
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
<script src=""></script>
<script src=""></script>
/* Set height of the grid so .sidenav can be 100% (adjust if needed) */
.row.content {height: 450px}
/* Set gray background color and 100% height */
.sidenav {
background-color: #f1f1f1;
height: 250px;
margin-left: 15px;
margin-top: 15px;
/* Set black background color, white text and some padding */
footer {
background-color: #007399;
color: white;
padding: 15px;
text-align: center;
header {
background-color: #007399;
color: white;
text-align: center;
height: 135px;
padding-top: 25px;
font-size: 50px;
/* On small screens, set height to 'auto' for sidenav and grid */
@media screen and (max-width: 767px) {
.sidenav {
height: inherit;
padding: 15px;
.row.content {height: 450px;}
<div class="container-fluid">
<header class="container-fluid">
<p>This is header</p>
<div class="row content">
<div class="col-sm-3 sidenav">
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#section1">nav 1</a></li>
<li><a href="#section2">nav 2</a></li>
<li><a href="#section3">nav 3</a></li>
<li><a href="#section3">nav 4</a></li>
<div class="col-sm-7">
<h4><small>this is body</small></h4>
<table class="table">
<th>post title</th>
<th>created by</th>
//membuat koneksi ke database
$host = 'localhost';
$user = 'root';
$password = '';
$database = 'db_blog';
$conn=new mysqli($host, $user, $password, $database);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
// Perintah untuk menampilkan data
$queri="select post.title, user.username, coment.coment from post, user, coment where and post.id_post=coment.postid " ; //menampikan SEMUA data dari tabel siswa
$result = $conn->query($queri);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>". $row["title"]. " </td> " . "<td>".$row["username"]. "</td> " ."<td>"
. $row["coment"]. "</td></tr>";
} else {
echo "0 results";
<footer class="container-fluid">
<p>Footer Text</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment