no display o output kapag nag iinput ako pero pumapasok sya sa database ..
<div class="container col-md-6 bg-body-tertiary border mt-3 rounded-3" >
<form method="POST">
<input type="hidden" name="id" value="<?php echo $username; ?>">
<label class="fw-bold mb-2" for="w3review">Comment:</label>
<textarea name="comment_content" class="form-control" rows="4" cols="40" placeholder="Your Content....."></textarea>
<div class="form-group mb-2 mt-2" style="text-align: right">
<input type="submit" name="comment" value="Reply" class="w-25" style="background-color:#0D52C7;">
</div>
</form>
</div>
<?php
if (isset($_POST['comment'])){
$comment_content = $_POST['comment_content'];
$post_id=$_POST['id'];
mysqli_query($con,"INSERT INTO comment (comment,date_posted,user_id,comment_id) VALUES('$comment_content','".strtotime(date("Y-m-d h:i:sa"))."','$user_id','$post_id')") or die (mysqli_error());
}
?>
<?php
$comment_query = mysqli_query($con,"SELECT * FROM comment LEFT JOIN registration on registration.user_id = comment.user_id WHERE comment_id = '$id'") or die (mysqli_error());
while($comment_row = mysqli_fetch_array($comment_query)){
$comment_id = $comment_row['comment_id'];
$comment_by = $comment_row['username'];
?>
<div class="container col-md-6 bg-body-tertiary border rounded-3" >
<a style="text-decoration:none; float:left;" href="deletepost.php<?php echo '?id='.$id; ?>">
<div class="pt-3">
<h5>Posted by: <a href="#" style= "margin-left:10px; text-decoration:none;"> <?php echo $comment_by; ?></a></h5>
<h6><?php echo $comment_row['username']; ?></h6>
<h5><?php echo $comment_row['comment']; }}?></h5>
<div class="container col-md-6 bg-body-tertiary border mt-3 rounded-3" >
<form method="POST">
<input type="hidden" name="id" value="<?php echo $username; ?>">
<label class="fw-bold mb-2" for="w3review">Comment:</label>
<textarea name="comment_content" class="form-control" rows="4" cols="40" placeholder="Your Content....."></textarea>
<div class="form-group mb-2 mt-2" style="text-align: right">
<input type="submit" name="comment" value="Reply" class="w-25" style="background-color:#0D52C7;">
</div>
</form>
</div>
<?php
if (isset($_POST['comment'])){
$comment_content = $_POST['comment_content'];
$post_id=$_POST['id'];
mysqli_query($con,"INSERT INTO comment (comment,date_posted,user_id,comment_id) VALUES('$comment_content','".strtotime(date("Y-m-d h:i:sa"))."','$user_id','$post_id')") or die (mysqli_error());
}
?>
<?php
$comment_query = mysqli_query($con,"SELECT * FROM comment LEFT JOIN registration on registration.user_id = comment.user_id WHERE comment_id = '$id'") or die (mysqli_error());
while($comment_row = mysqli_fetch_array($comment_query)){
$comment_id = $comment_row['comment_id'];
$comment_by = $comment_row['username'];
?>
<div class="container col-md-6 bg-body-tertiary border rounded-3" >
<a style="text-decoration:none; float:left;" href="deletepost.php<?php echo '?id='.$id; ?>">
<div class="pt-3">
<h5>Posted by: <a href="#" style= "margin-left:10px; text-decoration:none;"> <?php echo $comment_by; ?></a></h5>
<h6><?php echo $comment_row['username']; ?></h6>
<h5><?php echo $comment_row['comment']; }}?></h5>