pwede ko ba pagsamahin o i join yan tatlo database post, registration at comment..
$sql = mysqli_query($con, "SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM post inner join registration on registration.user_id = post.user_id") or die (mysqli_error());
while($post_row = mysqli_fetch_array($sql,)){
$id_user = $post_row['username'];
$id_comment = $post_row ['comment_id'];
?>
<hr>
<div class="">
<?php echo $id_user;?><a href="postinsert1.php?id=<?php echo $id_comment;?>"><?php echo $post_row['title']; ?></a>
<?php
}
$sql_query = mysqli_query($con, "SELECT * FROM comment inner join registration on registration.user_id = comment.user_id") or die (mysqli_error());
while($comment_row = mysqli_fetch_array($sql_query)){
$id_user = $comment_row['username'];
$id_comment = $comment_row ['comment_id'];
?>
<a href="comment1.php?id_comment=<?php echo $id_comment;?>"></a>
<?php
$sql = mysqli_query($con, "SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM post inner join registration on registration.user_id = post.user_id") or die (mysqli_error());
while($post_row = mysqli_fetch_array($sql,)){
$id_user = $post_row['username'];
$id_comment = $post_row ['comment_id'];
?>
<hr>
<div class="">
<?php echo $id_user;?><a href="postinsert1.php?id=<?php echo $id_comment;?>"><?php echo $post_row['title']; ?></a>
<?php
}
$sql_query = mysqli_query($con, "SELECT * FROM comment inner join registration on registration.user_id = comment.user_id") or die (mysqli_error());
while($comment_row = mysqli_fetch_array($sql_query)){
$id_user = $comment_row['username'];
$id_comment = $comment_row ['comment_id'];
?>
<a href="comment1.php?id_comment=<?php echo $id_comment;?>"></a>
<?php