Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in F:\xampp\htdocs\ajax\server.php on line 55
// Retrieve comments from database
$sql = "SELECT * FROM comments";
$result = mysqli_query($conn, $sql);
$comments = '<div id="display_area">'; 
while ($row = mysqli_fetch_array($result)) {
$comments .= '<div class="comment_box"> <span class="delete" data-id="' . $row['id'] . '" >delete</span> <span class="edit" data-id="' . $row['id'] . '">edit</span> <div class="display_name">'. $row['name'] .'</div> <div class="comment_text">'. $row['comment'] .'</div> </div>';
}
$comments .= '</div>';

?>