query($sql); if ($result->num_rows == 0) $sql = "SELECT * FROM blogposts where storeid='' and poststatus='publish' and postdate<=now() and find_in_set('" .str_replace("-"," ",$category). "',category) order by postdate desc"; $result = $conn->query($sql); if ($result->num_rows > 0){ while($row = $result->fetch_assoc()){ ?> There are no posts in this category.

"; ?>