forked from if-itb/IF3110-01-Simple-Blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload_comment.php
More file actions
22 lines (21 loc) · 758 Bytes
/
load_comment.php
File metadata and controls
22 lines (21 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include 'mysql.php';
include 'phpfunction.php';
$id_post = $_GET['id'];
?>
<ul class="art-list-body">
<?php
$thecomments = $con->prepare("SELECT nama, tanggal, komentar FROM comments WHERE comments.id_post = '$id_post' ORDER BY tanggal, id_comment DESC");
$thecomments->execute();
$thecomments->bind_result($cnama, $ctanggal, $ckomentar);
while ($thecomments->fetch()):
?>
<li class="art-list-item">
<div class="art-list-item-title-and-time">
<h2 class="art-list-title"><a href="post.php"><?php echo $cnama; ?></a></h2>
<div class="art-list-time"><?php echo StrTanggal($ctanggal); ?></div>
</div>
<p><?php echo $ckomentar; ?> …</p>
</li>
<?php endwhile?>
</ul>