- Joined
- Oct 20, 2014
- Posts
- 1,177
- Solutions
- 2
- Reaction
- 105
- Points
- 501
- Age
- 30
anu kaya ibig sabihin ng error na to pano mafix
Fatal error: Uncaught TypeError: mysqli_fetch_array(): Argument #1 ($result) must be of type mysqli_result, array given in C:\xampp\htdocs\Innerjoin\user\replies.php:47 Stack trace: #0 C:\xampp\htdocs\Innerjoin\user\replies.php(47): mysqli_fetch_array(Array) #1 {main} thrown in C:\xampp\htdocs\Innerjoin\user\replies.php on line 47
ito code nya
<?php
$post_query = mysqli_query($con, "SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM post LEFT JOIN registration on registration.user_id = post.user_id where comment_id = '$id_comment' ORDER BY comment_id DESC limit 1 ") or die (mysqli_error());
$content_row = mysqli_fetch_array($post_query);
while($post_row = mysqli_fetch_array($content_row)){
$id = $post_row['comment_id'];
$upid = $post_row['user_id'];
$posted_by = $post_row['username'];
if (mysqli_num_rows($content_query) > 0) {
// Code to display the content
echo '<div class="container col-md-6 bg-body-tertiary border rounded-3">'.$content_row['comment'].'</div>';
} else {
// Code to handle when no content is found
}
?>
Fatal error: Uncaught TypeError: mysqli_fetch_array(): Argument #1 ($result) must be of type mysqli_result, array given in C:\xampp\htdocs\Innerjoin\user\replies.php:47 Stack trace: #0 C:\xampp\htdocs\Innerjoin\user\replies.php(47): mysqli_fetch_array(Array) #1 {main} thrown in C:\xampp\htdocs\Innerjoin\user\replies.php on line 47
ito code nya
<?php
$post_query = mysqli_query($con, "SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM post LEFT JOIN registration on registration.user_id = post.user_id where comment_id = '$id_comment' ORDER BY comment_id DESC limit 1 ") or die (mysqli_error());
$content_row = mysqli_fetch_array($post_query);
while($post_row = mysqli_fetch_array($content_row)){
$id = $post_row['comment_id'];
$upid = $post_row['user_id'];
$posted_by = $post_row['username'];
if (mysqli_num_rows($content_query) > 0) {
// Code to display the content
echo '<div class="container col-md-6 bg-body-tertiary border rounded-3">'.$content_row['comment'].'</div>';
} else {
// Code to handle when no content is found
}
?>