paano ko kaya maicconnect yun $id_comment sa kabilang file
itong una code ko is nasa kabilang file na post.php
<?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 * ,UNIX_TIMESTAMP() - date_posted AS TimeSpent FROM comment inner JOIN registration on registration.user_id = comment.user_id where comment_id = '$id' AND comment_id = '$id_comment' order by comment.date_posted DESC") or die (mysqli_error());
while ($comment_row = mysqli_fetch_array($comment_query)){
$comment_id = $comment_row['id'];
$comment_by = $comment_row['username'];
?>
ito naman pangalawa code ay sa ibang file ay nasa posting.php
<?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 * ,UNIX_TIMESTAMP() - date_posted AS TimeSpent FROM comment inner JOIN registration on registration.user_id = comment.user_id where comment_id = '$id' AND comment_id = '$id_comment' order by comment.date_posted DESC") or die (mysqli_error());
while ($comment_row = mysqli_fetch_array($comment_query)){
$comment_id = $comment_row['id'];
$comment_by = $comment_row['username'];
?>
itong una code ko is nasa kabilang file na post.php
<?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 * ,UNIX_TIMESTAMP() - date_posted AS TimeSpent FROM comment inner JOIN registration on registration.user_id = comment.user_id where comment_id = '$id' AND comment_id = '$id_comment' order by comment.date_posted DESC") or die (mysqli_error());
while ($comment_row = mysqli_fetch_array($comment_query)){
$comment_id = $comment_row['id'];
$comment_by = $comment_row['username'];
?>
ito naman pangalawa code ay sa ibang file ay nasa posting.php
<?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 * ,UNIX_TIMESTAMP() - date_posted AS TimeSpent FROM comment inner JOIN registration on registration.user_id = comment.user_id where comment_id = '$id' AND comment_id = '$id_comment' order by comment.date_posted DESC") or die (mysqli_error());
while ($comment_row = mysqli_fetch_array($comment_query)){
$comment_id = $comment_row['id'];
$comment_by = $comment_row['username'];
?>