After indenting your code correctly, you get
$resultcount=mysqli_num_rows($result);
if(($resultcount)>0){
while ($row =mysqli_fetch_array($result)){
echo '<tr>
<td>'. $row["id"].'</td>
<td>'. $row["name"].'</td>
<td>'.$row["message"].'</td>
</tr>';
}
echo'</table>';
}
else{
echo'<tr>
<td>'. $row["id"].'</td>
<td>'. $row["name"].'</td>
<td>'.$row["message"].'</td>
</tr>';
}
the code just makes no sense.
Advice: Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spotting structures mistakes.
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<?php
session_start();
include("connectdb.php");
if( isset( $_SESSION['name'])) {
$name = $_SESSION['name'];
$query = "SELECT * from approvedhouse where name = '$name';";
$result=mysqli_query($conn,$query);
echo '<div class="container">
<h3>Application status</h3>
<table class="table table-hover" >
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Status</th>
<p></p>
</tr>
</thead> ';
$resultcount=mysqli_num_rows($result);
if(($resultcount)>0){
while ($row =mysqli_fetch_array($result)){
echo '<tr>
<td>'. $row["id"].'</td>
<td>'. $row["name"].'</td>
<td>'.$row["message"].'</td>
</tr>';
}
echo'</table>';
}
else{
echo'<tr>
<td>'. $row["id"].'</td>
<td>'. $row["name"].'</td>
<td>'.$row["message"].'</td>
</tr>';
}
}
?>
</body>
</html>
Indentation style - Wikipedia[
^]
Professional programmer's editors have this feature and others ones such as parenthesis matching and syntax highlighting.
Notepad++ Home[
^]
ultraedit[
^]