Fatal error: Uncaught TypeError: mysqli_fetch_array(): Argument #2 ($mode) must be of type int, mysqli_result given in C:\xampp\htdocs\Innerjoin\user\dashboard.php:95 Stack trace: #0 C:\xampp\htdocs\Innerjoin\user\dashboard.php(95): mysqli_fetch_array(Object(mysqli_result), Object(mysqli_result)) #1 {main} thrown in C:\xampp\htdocs\Innerjoin\user\dashboard.php on line 95
$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());
$sql_query = mysqli_query($con, "SELECT *, UNIX_TIMESTAMP() - date_posted AS TimeSpent FROM comment inner join registration on registration.user_id = comment.user_id") or die (mysqli_error());
while($post_row = mysqli_fetch_array($sql,$sql_query)){
$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>
$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());
$sql_query = mysqli_query($con, "SELECT *, UNIX_TIMESTAMP() - date_posted AS TimeSpent FROM comment inner join registration on registration.user_id = comment.user_id") or die (mysqli_error());
while($post_row = mysqli_fetch_array($sql,$sql_query)){
$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>