I am having a bit of an issue if there is no categories I need to echo no categories if there is I need it to echo There are categories. it shows if there is categories, but don't show if there is not.
<tr>
<?php
$db = dbconnect();
$stmt = $db->prepare("SELECT * FROM discussion_categories");
$stmt->execute();
$result = $stmt->get_result();
while (($row = mysqli_fetch_assoc($result)) == true) {
$CategoryID = $row['CategoryID'];
$Name = $row['Name'];
$Description = $row['Description'];
$Photo = $row['Photo'];
if(!empty($CategoryID['CategoryID'])){
echo "<td>No categories</td>";
} else {
echo "<td colspan='4'><img class='profile-photo' src='" . ROOT_URI . "/uploads/" . $Photo . "'></td>";
echo "<td colspan='4'><a href='discussions.php?view={$CategoryID}'>{$Name}</a></td>";
echo "<td><a href='managecategories.php?delete={$CategoryID}'>delete</a></td>";
}
}
?>
</tr>