Guys, i am getting an unexpected T_While Error on my code, I cannot figure it out. can you help?
<?php
$sql = "SELECT id, u_name, u_email, subj, phone FROM tb_cform ";
$result = $conn->query($sql);
echo '<table><tr><th>Name</th><th>Email</th><th>Subjec</th><th>Phone</th></tr>';
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["u_name"]."</td><td>".$row["u_email"]."</td><td>".$row["subj"]."</td><td>".$row["phone"]."</td></tr>";
}
} else {
echo "0 results";
}
echo "</table>";
$bd->close();
?>